Spaces:
Runtime error
Runtime error
Commit
·
4df10d7
1
Parent(s):
adf0c57
autoclear
Browse files
app.py
CHANGED
|
@@ -933,7 +933,8 @@ with gr.Blocks() as demo:
|
|
| 933 |
# upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
|
| 934 |
clear_button.click(clearall, None, [chatbot, submit_button, stop_button], voice_output)
|
| 935 |
retry_button.click(retry, chatbot, chatbot).success(playsound, None, voice_output).\
|
| 936 |
-
success(HMI_Wait, None, [submit_button, stop_button])
|
|
|
|
| 937 |
# inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
| 938 |
# then(playsound, None, voice_output)
|
| 939 |
# inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
|
@@ -942,11 +943,13 @@ with gr.Blocks() as demo:
|
|
| 942 |
# then(HMI_Wait, None, [submit_button, stop_button])
|
| 943 |
# inf4 = inputtext.submit(chathmi4, [inputtext, chatbot], [inputtext, chatbot, submit_button, stop_button])
|
| 944 |
inf4 = inputtext.submit(chathmi4, [inputtext, chatbot], [inputtext, chatbot, submit_button, stop_button]).\
|
| 945 |
-
success(playsound, None, voice_output)
|
|
|
|
| 946 |
inf3 = submit_button.click(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
| 947 |
success(HMI_Runing, None, [submit_button, stop_button]).\
|
| 948 |
success(playsound, None, voice_output).\
|
| 949 |
-
success(HMI_Wait, None, [submit_button, stop_button])
|
|
|
|
| 950 |
# inf2 = inputtext.submit(display_input, [inputtext, chatbot], chatbot).\
|
| 951 |
# then(Inference_Agent, chatbot, [inputtext, chatbot])
|
| 952 |
stop_button.click(read_logs, None, logs, cancels=[inf4,inf3]).\
|
|
@@ -956,11 +959,11 @@ with gr.Blocks() as demo:
|
|
| 956 |
agentchoice.change(SetAgent, agentchoice, None)
|
| 957 |
frash_logs.click(read_logs, None, logs)
|
| 958 |
# voice_output.end(ClearAudio, None, voice_output)
|
| 959 |
-
def clear_voice():
|
| 960 |
-
|
| 961 |
-
|
| 962 |
|
| 963 |
-
voice_output.play(clear_voice, None, None)
|
| 964 |
|
| 965 |
# demo.load(read_logs, None, logs, every=1)
|
| 966 |
|
|
|
|
| 933 |
# upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
|
| 934 |
clear_button.click(clearall, None, [chatbot, submit_button, stop_button], voice_output)
|
| 935 |
retry_button.click(retry, chatbot, chatbot).success(playsound, None, voice_output).\
|
| 936 |
+
success(HMI_Wait, None, [submit_button, stop_button]).\
|
| 937 |
+
success(ClearAudio, None, voice_output)
|
| 938 |
# inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
| 939 |
# then(playsound, None, voice_output)
|
| 940 |
# inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
|
|
|
| 943 |
# then(HMI_Wait, None, [submit_button, stop_button])
|
| 944 |
# inf4 = inputtext.submit(chathmi4, [inputtext, chatbot], [inputtext, chatbot, submit_button, stop_button])
|
| 945 |
inf4 = inputtext.submit(chathmi4, [inputtext, chatbot], [inputtext, chatbot, submit_button, stop_button]).\
|
| 946 |
+
success(playsound, None, voice_output).\
|
| 947 |
+
success(ClearAudio, None, voice_output)
|
| 948 |
inf3 = submit_button.click(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
|
| 949 |
success(HMI_Runing, None, [submit_button, stop_button]).\
|
| 950 |
success(playsound, None, voice_output).\
|
| 951 |
+
success(HMI_Wait, None, [submit_button, stop_button]).\
|
| 952 |
+
success(ClearAudio, None, voice_output)
|
| 953 |
# inf2 = inputtext.submit(display_input, [inputtext, chatbot], chatbot).\
|
| 954 |
# then(Inference_Agent, chatbot, [inputtext, chatbot])
|
| 955 |
stop_button.click(read_logs, None, logs, cancels=[inf4,inf3]).\
|
|
|
|
| 959 |
agentchoice.change(SetAgent, agentchoice, None)
|
| 960 |
frash_logs.click(read_logs, None, logs)
|
| 961 |
# voice_output.end(ClearAudio, None, voice_output)
|
| 962 |
+
# def clear_voice():
|
| 963 |
+
# print("clear audio ...")
|
| 964 |
+
# voice_output.clear()
|
| 965 |
|
| 966 |
+
# voice_output.play(clear_voice, None, None)
|
| 967 |
|
| 968 |
# demo.load(read_logs, None, logs, every=1)
|
| 969 |
|