YC-Chen commited on
Commit
85d5ae5
1 Parent(s): 0e3b221

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -157,7 +157,8 @@ with gr.Blocks() as demo:
157
  with s.post(API_URL, headers=HEADERS, json=data, stream=True, timeout=30) as r:
158
  for line in r.iter_lines():
159
  if line and keep_streaming:
160
- assert r.status_code == 200
 
161
  json_response = json.loads(line)
162
 
163
  try:
@@ -271,5 +272,5 @@ with gr.Blocks() as demo:
271
 
272
  gr.Markdown(LICENSE)
273
 
274
- demo.queue(concurrency_count=2, max_size=128)
275
  demo.launch()
 
157
  with s.post(API_URL, headers=HEADERS, json=data, stream=True, timeout=30) as r:
158
  for line in r.iter_lines():
159
  if line and keep_streaming:
160
+ if r.status_code != 200:
161
+ print('[warn] status_code != 200')
162
  json_response = json.loads(line)
163
 
164
  try:
 
272
 
273
  gr.Markdown(LICENSE)
274
 
275
+ demo.queue(concurrency_count=1, max_size=128)
276
  demo.launch()