Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -74,7 +74,7 @@ async def get_completion(payload: Payload, request: Request):
|
|
| 74 |
# Define a generator to stream the response
|
| 75 |
def stream_generator():
|
| 76 |
try:
|
| 77 |
-
with session.post(url, json=payload_dict, stream=True, timeout=
|
| 78 |
response.raise_for_status()
|
| 79 |
for chunk in response.iter_content(chunk_size=1024):
|
| 80 |
if chunk: # Only yield non-empty chunks
|
|
|
|
| 74 |
# Define a generator to stream the response
|
| 75 |
def stream_generator():
|
| 76 |
try:
|
| 77 |
+
with session.post(url, json=payload_dict, stream=True, timeout=15) as response:
|
| 78 |
response.raise_for_status()
|
| 79 |
for chunk in response.iter_content(chunk_size=1024):
|
| 80 |
if chunk: # Only yield non-empty chunks
|