Spaces:
Running
Running
clear state of chat history per-user
Browse files
app.py
CHANGED
|
@@ -215,10 +215,19 @@ class MyProfileAvatarChat(Config, FileReader):
|
|
| 215 |
if __name__ == "__main__":
|
| 216 |
|
| 217 |
my_profile = MyProfileAvatarChat()
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
-
demo.queue(max_size=10).launch( # allows up to 10 tasks in queue
|
| 221 |
-
server_name="0.0.0.0",
|
| 222 |
-
server_port=7860,
|
| 223 |
-
share=False)
|
| 224 |
|
|
|
|
| 215 |
if __name__ == "__main__":
|
| 216 |
|
| 217 |
my_profile = MyProfileAvatarChat()
|
| 218 |
+
with gr.Blocks() as demo:
|
| 219 |
+
# Per-user chat history state
|
| 220 |
+
state = gr.State([])
|
| 221 |
+
|
| 222 |
+
# Chat interface
|
| 223 |
+
chat = gr.ChatInterface(
|
| 224 |
+
my_profile.chat_traced
|
| 225 |
+
)
|
| 226 |
+
|
| 227 |
+
demo.queue(max_size=10).launch(
|
| 228 |
+
server_name="0.0.0.0",
|
| 229 |
+
show_error=7860,
|
| 230 |
+
share=False
|
| 231 |
+
)
|
| 232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
|