jh-didero commited on
Commit
7c04312
·
verified ·
1 Parent(s): 52b29a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -19,7 +19,7 @@ def get_thread_id(streaming_chat_thread_id_state):
19
  # except TypeError as e:
20
  # thread_id = None
21
  thread_id = streaming_chat_thread_id
22
- if not thread_id:
23
  thread = client.beta.threads.create()
24
  thread_id = thread.id
25
  print(f"new thread_id: {thread_id}")
@@ -51,6 +51,6 @@ def chat(user_message, history, streaming_chat_thread_id):
51
  yield from openai_chat(user_message, thread_id)
52
 
53
  history = []
54
- streaming_chat_thread_id = None# = gr.State({"thread_id": None})
55
  additional_inputs = [streaming_chat_thread_id]
56
  gr.ChatInterface(chat, examples=[["What are the troy rack mounting options?"], ["what are the steps for helen"], ["what are the main comparison between troy and janus specs"]], title="User Support Bot", additional_inputs=additional_inputs).launch(debug=True)
 
19
  # except TypeError as e:
20
  # thread_id = None
21
  thread_id = streaming_chat_thread_id
22
+ if not thread_id or thread_id == "Demo":
23
  thread = client.beta.threads.create()
24
  thread_id = thread.id
25
  print(f"new thread_id: {thread_id}")
 
51
  yield from openai_chat(user_message, thread_id)
52
 
53
  history = []
54
+ streaming_chat_thread_id = "Demo"# = gr.State({"thread_id": None})
55
  additional_inputs = [streaming_chat_thread_id]
56
  gr.ChatInterface(chat, examples=[["What are the troy rack mounting options?"], ["what are the steps for helen"], ["what are the main comparison between troy and janus specs"]], title="User Support Bot", additional_inputs=additional_inputs).launch(debug=True)