Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -395,16 +395,17 @@ with gr.Blocks() as demo:
|
|
395 |
# return chat(question, manual, history, liked_state.value)
|
396 |
def gradio_chat(question, manual, history):
|
397 |
save_last_interaction("N/A") # Save previous interaction before starting a new one
|
398 |
-
|
399 |
-
# Soruyu hemen history'ye ekle ve güncellenmiş history'yi döndür
|
400 |
history.append((question, ""))
|
401 |
yield "", history
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
408 |
|
409 |
textbox.submit(gradio_chat, [textbox, manual, chatbot], [textbox, chatbot])
|
410 |
chatbot.like(handle_like, None, None)
|
|
|
395 |
# return chat(question, manual, history, liked_state.value)
|
396 |
def gradio_chat(question, manual, history):
|
397 |
save_last_interaction("N/A") # Save previous interaction before starting a new one
|
|
|
|
|
398 |
history.append((question, ""))
|
399 |
yield "", history
|
400 |
+
|
401 |
+
chat_generator = chat(question, manual, history, liked_state.value)
|
402 |
+
final_response = ""
|
403 |
+
final_history = history
|
404 |
+
for partial_response, updated_history in chat_generator:
|
405 |
+
final_response += partial_response
|
406 |
+
final_history = updated_history
|
407 |
+
yield "", final_history
|
408 |
+
return "", final_history
|
409 |
|
410 |
textbox.submit(gradio_chat, [textbox, manual, chatbot], [textbox, chatbot])
|
411 |
chatbot.like(handle_like, None, None)
|