Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,12 @@ def chat(p, qid, uid):
|
|
| 16 |
count = 0
|
| 17 |
count = count+1
|
| 18 |
history[uid] = count # 统计每个 uid 说过的话的条数
|
| 19 |
-
return ["text", f"{count} {p}{p}{p}"]
|
| 20 |
|
| 21 |
iface = gr.Interface(fn=chat,
|
| 22 |
inputs=["text", "text", "text"],
|
| 23 |
outputs=["text", "text"],
|
| 24 |
-
description="""
|
| 25 |
已添加多轮对话的极简示范。能分别统计不同的 uid 的对话轮数。但本实现是内存中的,一旦重启即被清空。如需可持久的多轮对话,需要改用数据库等方式。
|
| 26 |
""")
|
| 27 |
iface.launch()
|
|
|
|
| 16 |
count = 0
|
| 17 |
count = count+1
|
| 18 |
history[uid] = count # 统计每个 uid 说过的话的条数
|
| 19 |
+
return ["text", f"{count} {p}{","}{p}{p}"]
|
| 20 |
|
| 21 |
iface = gr.Interface(fn=chat,
|
| 22 |
inputs=["text", "text", "text"],
|
| 23 |
outputs=["text", "text"],
|
| 24 |
+
description="""这是一个极其简单的小机器人,名字叫「重要的事情说三遍机器人」,当你说一件事情,它会帮你重复三遍。
|
| 25 |
已添加多轮对话的极简示范。能分别统计不同的 uid 的对话轮数。但本实现是内存中的,一旦重启即被清空。如需可持久的多轮对话,需要改用数据库等方式。
|
| 26 |
""")
|
| 27 |
iface.launch()
|