Spaces:
Runtime error
Runtime error
ThongAccount
commited on
Commit
·
917d560
1
Parent(s):
a132611
dweasdwa
Browse files
app.py
CHANGED
@@ -57,13 +57,20 @@ def respond(
|
|
57 |
|
58 |
return answer_vi
|
59 |
|
60 |
-
#
|
61 |
-
|
62 |
fn=respond,
|
63 |
title="🤖 Trợ lý AI Tiếng Việt (Translate-then-Predict)",
|
64 |
description="💬 Nhập tiếng Việt ➔ dịch tiếng Anh ➔ hỏi model ➔ dịch lại tiếng Việt.",
|
65 |
-
theme="soft"
|
66 |
)
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
if __name__ == "__main__":
|
69 |
-
demo.launch(
|
|
|
57 |
|
58 |
return answer_vi
|
59 |
|
60 |
+
# Tạo ChatInterface
|
61 |
+
chat = gr.ChatInterface(
|
62 |
fn=respond,
|
63 |
title="🤖 Trợ lý AI Tiếng Việt (Translate-then-Predict)",
|
64 |
description="💬 Nhập tiếng Việt ➔ dịch tiếng Anh ➔ hỏi model ➔ dịch lại tiếng Việt.",
|
65 |
+
theme="soft",
|
66 |
)
|
67 |
|
68 |
+
# Gói nó trong gr.Blocks
|
69 |
+
with gr.Blocks() as demo:
|
70 |
+
chat.render()
|
71 |
+
|
72 |
+
# ⚡ Bật OpenAPI để Huggingface Spaces nhận diện được API
|
73 |
+
demo.openapi = True
|
74 |
+
|
75 |
if __name__ == "__main__":
|
76 |
+
demo.launch()
|