Mariusz47 commited on
Commit
21736a1
·
1 Parent(s): 3a27bad

clear state of chat history per-user

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -215,10 +215,19 @@ class MyProfileAvatarChat(Config, FileReader):
215
  if __name__ == "__main__":
216
 
217
  my_profile = MyProfileAvatarChat()
218
- demo = gr.ChatInterface(my_profile.chat_traced)
 
 
 
 
 
 
 
 
 
 
 
 
 
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