Spaces:
Running
Running
Commit
·
81b8166
1
Parent(s):
2547e78
updatation
Browse files
app.py
CHANGED
|
@@ -350,15 +350,12 @@ with gr.Blocks(title="Tayyab — Chatbot") as demo:
|
|
| 350 |
new_chat_btn.click(new_chat, outputs=[chatbot])
|
| 351 |
|
| 352 |
def export_handler(history):
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
formatted.append({"role": "assistant", "content": a})
|
| 360 |
-
|
| 361 |
-
files = export_chat_files(formatted)
|
| 362 |
return (
|
| 363 |
gr.update(value=files.get("txt"), visible=True),
|
| 364 |
gr.update(value=files.get("pdf"), visible=bool(files.get("pdf")))
|
|
|
|
| 350 |
new_chat_btn.click(new_chat, outputs=[chatbot])
|
| 351 |
|
| 352 |
def export_handler(history):
|
| 353 |
+
|
| 354 |
+
if not isinstance(history, list):
|
| 355 |
+
history = []
|
| 356 |
+
|
| 357 |
+
files = export_chat_files(history)
|
| 358 |
+
|
|
|
|
|
|
|
|
|
|
| 359 |
return (
|
| 360 |
gr.update(value=files.get("txt"), visible=True),
|
| 361 |
gr.update(value=files.get("pdf"), visible=bool(files.get("pdf")))
|