mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 18:33:57 +01:00
Compare commits
1 commit
83df730edb
...
45613e0537
Author | SHA1 | Date | |
---|---|---|---|
45613e0537 |
|
@ -151,7 +151,7 @@ async def respond(
|
||||||
chunk = chunk.decode('utf8').strip()
|
chunk = chunk.decode('utf8').strip()
|
||||||
|
|
||||||
if 'azure' in provider_name:
|
if 'azure' in provider_name:
|
||||||
chunk = chunk.strip().replace('data: ', '')
|
chunk = chunk.strip().replace('data: ', '', 1)
|
||||||
|
|
||||||
if not chunk or 'prompt_filter_results' in chunk:
|
if not chunk or 'prompt_filter_results' in chunk:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -100,7 +100,7 @@ async def test_chat_stream_gpt3() -> float:
|
||||||
|
|
||||||
async for chunk in response.aiter_text():
|
async for chunk in response.aiter_text():
|
||||||
for subchunk in chunk.split('\n\n'):
|
for subchunk in chunk.split('\n\n'):
|
||||||
chunk = subchunk.replace('data: ', '').strip()
|
chunk = subchunk.replace('data: ', '', 1).strip()
|
||||||
|
|
||||||
if chunk == '[DONE]':
|
if chunk == '[DONE]':
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue