QL2023 commited on
Commit
f38a39c
·
verified ·
1 Parent(s): 6bcae89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -5,17 +5,19 @@ import os
5
  root = os.environ["ROOT"]
6
  #############################################################
7
 
8
- url = root + "/api/create"
9
- PARAMS = {'context1':"context1"}
 
 
10
 
11
- response = requests.get(
12
  url,
13
  stream=True,
14
  headers={"accept": "*/*"},
15
  params = PARAMS
16
- )
17
 
18
- for chunk in response.iter_content(chunk_size=512):
19
  thread = str(chunk, encoding="utf-8")
20
 
21
  def predict(message, history):
 
5
  root = os.environ["ROOT"]
6
  #############################################################
7
 
8
+ thread = ""
9
+ while not thread.startswith("thread"):
10
+ url = root + "/api/create"
11
+ PARAMS = {'context1':"context1"}
12
 
13
+ response = requests.get(
14
  url,
15
  stream=True,
16
  headers={"accept": "*/*"},
17
  params = PARAMS
18
+ )
19
 
20
+ for chunk in response.iter_content(chunk_size=512):
21
  thread = str(chunk, encoding="utf-8")
22
 
23
  def predict(message, history):