YC-Chen commited on
Commit
0a0f44e
1 Parent(s): 958445c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -156,7 +156,8 @@ with gr.Blocks() as demo:
156
 
157
  start_time = time.time()
158
  keep_streaming = True
159
- with requests.post(API_URL, headers=HEADERS, json=data, stream=True, timeout=30) as r:
 
160
  for line in r.iter_lines():
161
  if line and keep_streaming:
162
  assert r.status_code == 200
 
156
 
157
  start_time = time.time()
158
  keep_streaming = True
159
+ s = requests.Session()
160
+ with s.post(API_URL, headers=HEADERS, json=data, stream=True) as r:
161
  for line in r.iter_lines():
162
  if line and keep_streaming:
163
  assert r.status_code == 200