gnilets commited on
Commit
4b750bc
·
verified ·
1 Parent(s): ad4dcc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -124,8 +124,9 @@ async def proxy_openai_api(request: Request):
124
 
125
  content = bytearray()
126
  async for chunk in stream_response.aiter_bytes():
127
- yield chunk
128
- content.extend(chunk)
 
129
 
130
  except RequestError as exc:
131
  raise HTTPException(status_code=500, detail=f'произошла ошибка при запросе: {exc}')
 
124
 
125
  content = bytearray()
126
  async for chunk in stream_response.aiter_bytes():
127
+ if chunk.strip()
128
+ yield chunk.strip()
129
+ content.extend(chunk.strip())
130
 
131
  except RequestError as exc:
132
  raise HTTPException(status_code=500, detail=f'произошла ошибка при запросе: {exc}')