OuroborosM commited on
Commit
ad276ce
·
1 Parent(s): 897c3b6

add textclear

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -783,6 +783,9 @@ def Inference_Agent(history_inf):
783
  except Exception as e:
784
  print("error:", e)
785
 
 
 
 
786
  with gr.Blocks() as demo:
787
  # gr.Markdown("Start typing below and then click **SUBMIT** to see the output.")
788
  # main = gr.ChatInterface(
@@ -846,7 +849,7 @@ with gr.Blocks() as demo:
846
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot])
847
  inf2 = inputtext.submit(display_input, [inputtext, chatbot], chatbot).\
848
  then(Inference_Agent, chatbot, chatbot).\
849
- then(None, None, inputtext = "")
850
  stop_button.click(read_logs, None, logs, cancels=[inf2])
851
  upload_button.upload(func_upload_file, [upload_button, chatbot], chatbot)
852
  agentchoice.change(SetAgent, agentchoice, None)
 
783
  except Exception as e:
784
  print("error:", e)
785
 
786
+ def ClearText():
787
+ return ""
788
+
789
  with gr.Blocks() as demo:
790
  # gr.Markdown("Start typing below and then click **SUBMIT** to see the output.")
791
  # main = gr.ChatInterface(
 
849
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot])
850
  inf2 = inputtext.submit(display_input, [inputtext, chatbot], chatbot).\
851
  then(Inference_Agent, chatbot, chatbot).\
852
+ then(ClearText, None, inputtext)
853
  stop_button.click(read_logs, None, logs, cancels=[inf2])
854
  upload_button.upload(func_upload_file, [upload_button, chatbot], chatbot)
855
  agentchoice.change(SetAgent, agentchoice, None)