Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -156,7 +156,8 @@ with gr.Blocks() as demo:
|
|
156 |
|
157 |
start_time = time.time()
|
158 |
keep_streaming = True
|
159 |
-
|
|
|
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
|