Spaces:
Runtime error
Runtime error
giannantonio15
commited on
Commit
•
28a124d
1
Parent(s):
1944740
Update app.py
Browse files
app.py
CHANGED
@@ -113,7 +113,7 @@ css = """
|
|
113 |
"""
|
114 |
user_message=""
|
115 |
current_chat_mode=""
|
116 |
-
current_response_mode="
|
117 |
current_collection=""
|
118 |
file_path=""
|
119 |
num_responses=0
|
@@ -380,7 +380,7 @@ def main():
|
|
380 |
["BANDI_SISTEMA_PUGLIA","BANDI"], label="Collezione di documenti", info="", container=False, interactive=True, value="BANDI_SISTEMA_PUGLIA", elem_id="dropdown"
|
381 |
).select(fn=select_collection, outputs=output)
|
382 |
|
383 |
-
gr.Radio(["compact","tree_summarize"], label="Response mode", info="Influenzerà il modo in cui il chatbot risponde", interactive=True,container=False, value="
|
384 |
divDocumenti = gr.HTML("<div id='divDocumenti'></div>")
|
385 |
msg = gr.Textbox(elem_id="textBox", container=False)
|
386 |
clear = gr.ClearButton([msg, chatbot], elem_id="btnClear")
|
@@ -393,7 +393,7 @@ def main():
|
|
393 |
history = []
|
394 |
|
395 |
return "", history + [[user_message, None]]
|
396 |
-
|
397 |
def bot(history):
|
398 |
lenght = len(history)
|
399 |
userMessage = history[lenght-1][0]
|
|
|
113 |
"""
|
114 |
user_message=""
|
115 |
current_chat_mode=""
|
116 |
+
current_response_mode="tree_summarize"
|
117 |
current_collection=""
|
118 |
file_path=""
|
119 |
num_responses=0
|
|
|
380 |
["BANDI_SISTEMA_PUGLIA","BANDI"], label="Collezione di documenti", info="", container=False, interactive=True, value="BANDI_SISTEMA_PUGLIA", elem_id="dropdown"
|
381 |
).select(fn=select_collection, outputs=output)
|
382 |
|
383 |
+
gr.Radio(["compact","tree_summarize"], label="Response mode", info="Influenzerà il modo in cui il chatbot risponde", interactive=True,container=False, value="tree_summarize",elem_id="responseMode").select(fn=select_response_mode, outputs=output),
|
384 |
divDocumenti = gr.HTML("<div id='divDocumenti'></div>")
|
385 |
msg = gr.Textbox(elem_id="textBox", container=False)
|
386 |
clear = gr.ClearButton([msg, chatbot], elem_id="btnClear")
|
|
|
393 |
history = []
|
394 |
|
395 |
return "", history + [[user_message, None]]
|
396 |
+
@spaces.GPU(duration=120)
|
397 |
def bot(history):
|
398 |
lenght = len(history)
|
399 |
userMessage = history[lenght-1][0]
|