Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def generate_answer(question, chat_history):
|
|
42 |
#return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
43 |
|
44 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
|
45 |
-
chat_history.append(
|
46 |
return "", chat_history
|
47 |
|
48 |
# === Gradio UI ===
|
@@ -76,7 +76,8 @@ with gr.Blocks(theme=gr.themes.Base()) as interface:
|
|
76 |
outputs=[question_box, chatbot],
|
77 |
)
|
78 |
|
79 |
-
clear_btn.click(lambda: [], inputs=[], outputs=[chatbot, state])
|
|
|
80 |
|
81 |
# === Launch the app ===
|
82 |
interface.launch(share=True)
|
|
|
42 |
#return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
43 |
|
44 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
|
45 |
+
chat_history.append([question, answer])
|
46 |
return "", chat_history
|
47 |
|
48 |
# === Gradio UI ===
|
|
|
76 |
outputs=[question_box, chatbot],
|
77 |
)
|
78 |
|
79 |
+
clear_btn.click(lambda: ([], []), inputs=[], outputs=[chatbot, state])
|
80 |
+
|
81 |
|
82 |
# === Launch the app ===
|
83 |
interface.launch(share=True)
|