Spaces:
Runtime error
Runtime error
clr 8
Browse files
app.py
CHANGED
|
@@ -52,6 +52,7 @@ def doc_emb(doc: str):
|
|
| 52 |
|
| 53 |
def get_response(msg, bot, doc_text_list, doc_embeddings):
|
| 54 |
# future = thread_pool_executor.submit(get_emb, msg)
|
|
|
|
| 55 |
now_len = len(msg)
|
| 56 |
req_json = {'question': msg}
|
| 57 |
his_bg = -1
|
|
@@ -149,10 +150,6 @@ def up_file(files):
|
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
-
def my_function(text):
|
| 153 |
-
# your function code here
|
| 154 |
-
return gr.Textbox.update(value='')
|
| 155 |
-
|
| 156 |
|
| 157 |
with gr.Blocks(css=".gradio-container {background-color: Tomato}, footer {visibility: hidden}") as demo:
|
| 158 |
with gr.Row():
|
|
@@ -174,7 +171,7 @@ with gr.Blocks(css=".gradio-container {background-color: Tomato}, footer {visibi
|
|
| 174 |
|
| 175 |
file.change(up_file, [file], [txt, doc_bu, md]) #hiding the text
|
| 176 |
doc_bu.click(doc_emb, [txt], [doc_text_state, doc_emb_state, msg_txt, chat_bu, md, chat_bot])
|
| 177 |
-
msg_txt.submit(get_response, [msg_txt, chat_bot,doc_text_state, doc_emb_state], [chat_bot])
|
| 178 |
chat_bu.click(lambda: None, None, chat_bot, queue=False)
|
| 179 |
|
| 180 |
if __name__ == "__main__":
|
|
|
|
| 52 |
|
| 53 |
def get_response(msg, bot, doc_text_list, doc_embeddings):
|
| 54 |
# future = thread_pool_executor.submit(get_emb, msg)
|
| 55 |
+
gr.Textbox.update(value="")
|
| 56 |
now_len = len(msg)
|
| 57 |
req_json = {'question': msg}
|
| 58 |
his_bg = -1
|
|
|
|
| 150 |
|
| 151 |
|
| 152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
with gr.Blocks(css=".gradio-container {background-color: Tomato}, footer {visibility: hidden}") as demo:
|
| 155 |
with gr.Row():
|
|
|
|
| 171 |
|
| 172 |
file.change(up_file, [file], [txt, doc_bu, md]) #hiding the text
|
| 173 |
doc_bu.click(doc_emb, [txt], [doc_text_state, doc_emb_state, msg_txt, chat_bu, md, chat_bot])
|
| 174 |
+
msg_txt.submit(get_response, [msg_txt, chat_bot,doc_text_state, doc_emb_state], [chat_bot])
|
| 175 |
chat_bu.click(lambda: None, None, chat_bot, queue=False)
|
| 176 |
|
| 177 |
if __name__ == "__main__":
|