Omnibus commited on
Commit
7f6ba54
·
1 Parent(s): fa221ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -200,14 +200,15 @@ def summarize(inp,history,data=None,file=None):
200
  history.append((inp,rawp))
201
  yield "", history
202
  #################################
203
-
 
204
 
205
  with gr.Blocks() as app:
206
- gr.HTML("""<center><h1>Mixtral 8x7b TLDR Summarizer</h1><h3>Summarize Data of unlimited length</h3>""")
207
  chatbot = gr.Chatbot()
208
  with gr.Row():
209
  with gr.Column(scale=3):
210
- prompt=gr.Textbox(label = "Instructions")
211
  with gr.Column(scale=1):
212
  button=gr.Button()
213
 
@@ -217,9 +218,10 @@ with gr.Blocks() as app:
217
  clear_btn = gr.Button("Clear")
218
  with gr.Row():
219
  data=gr.Textbox(label="Input Data (paste text)", lines=6)
220
- file=gr.File(label="Input File (.pdf | .txt)")
221
  #text=gr.JSON()
222
  #inp_query.change(search_models,inp_query,models_dd)
 
223
  go=button.click(summarize,[prompt,chatbot,data,file],[prompt,chatbot])
224
  stop_button.click(None,None,None,cancels=[go])
225
  app.launch(server_port=7860,show_api=False)
 
200
  history.append((inp,rawp))
201
  yield "", history
202
  #################################
203
+ def clear_fn():
204
+ return "",[("","")]
205
 
206
  with gr.Blocks() as app:
207
+ gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer</h1><h3>Summarize Data of unlimited length</h3>""")
208
  chatbot = gr.Chatbot()
209
  with gr.Row():
210
  with gr.Column(scale=3):
211
+ prompt=gr.Textbox(label = "Instructions (optional)")
212
  with gr.Column(scale=1):
213
  button=gr.Button()
214
 
 
218
  clear_btn = gr.Button("Clear")
219
  with gr.Row():
220
  data=gr.Textbox(label="Input Data (paste text)", lines=6)
221
+ file=gr.File(label="Input File (.pdf .txt)")
222
  #text=gr.JSON()
223
  #inp_query.change(search_models,inp_query,models_dd)
224
+ clear_btn.click(clear_fn,None,[prompt,chatbot])
225
  go=button.click(summarize,[prompt,chatbot,data,file],[prompt,chatbot])
226
  stop_button.click(None,None,None,cancels=[go])
227
  app.launch(server_port=7860,show_api=False)