Spaces:
Sleeping
Sleeping
Commit
·
d83956b
1
Parent(s):
d90fb90
test deepseek
Browse files
app.py
CHANGED
@@ -30,11 +30,8 @@ with gr.Blocks() as demo: # Bắt đầu Blocks
|
|
30 |
chatbot = gr.Chatbot(type="messages") # hỗ trợ subset Markdown:contentReference[oaicite:3]{index=3}
|
31 |
|
32 |
# Thành phần Markdown để render kết quả đã format (Markdown + LaTeX)
|
33 |
-
|
34 |
-
latex_delimiters=[
|
35 |
-
{"left": "$$", "right": "$$", "display": True},
|
36 |
-
{"left": "$", "right": "$", "display": False},
|
37 |
-
]
|
38 |
) # cho phép render LaTeX:contentReference[oaicite:4]{index=4}
|
39 |
|
40 |
# Các input controls
|
@@ -52,11 +49,13 @@ with gr.Blocks() as demo: # Bắt đầu Blocks
|
|
52 |
|
53 |
# Sự kiện submit
|
54 |
txt.submit(
|
55 |
-
|
56 |
inputs=[txt, chatbot, sys_msg, max_t, temp, top_p, file_up, img_up],
|
57 |
-
outputs=[chatbot,
|
|
|
58 |
)
|
59 |
|
|
|
60 |
# Chạy app
|
61 |
if __name__ == "__main__":
|
62 |
demo.launch()
|
|
|
30 |
chatbot = gr.Chatbot(type="messages") # hỗ trợ subset Markdown:contentReference[oaicite:3]{index=3}
|
31 |
|
32 |
# Thành phần Markdown để render kết quả đã format (Markdown + LaTeX)
|
33 |
+
markdown = gr.Markdown(
|
34 |
+
latex_delimiters=[{"left":"$$","right":"$$","display":True}]
|
|
|
|
|
|
|
35 |
) # cho phép render LaTeX:contentReference[oaicite:4]{index=4}
|
36 |
|
37 |
# Các input controls
|
|
|
49 |
|
50 |
# Sự kiện submit
|
51 |
txt.submit(
|
52 |
+
fn=respond,
|
53 |
inputs=[txt, chatbot, sys_msg, max_t, temp, top_p, file_up, img_up],
|
54 |
+
outputs=[chatbot, markdown],
|
55 |
+
api_name="predict"
|
56 |
)
|
57 |
|
58 |
+
|
59 |
# Chạy app
|
60 |
if __name__ == "__main__":
|
61 |
demo.launch()
|