fix potential process stuck issue
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
@@ -220,6 +221,7 @@ class BedrockModel(BaseChatModel):
|
|||||||
# and the choices field will always be an empty array.
|
# and the choices field will always be an empty array.
|
||||||
# All other chunks will also include a usage field, but with a null value.
|
# All other chunks will also include a usage field, but with a null value.
|
||||||
yield self.stream_response_to_bytes(stream_response)
|
yield self.stream_response_to_bytes(stream_response)
|
||||||
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
# return an [DONE] message at the end.
|
# return an [DONE] message at the end.
|
||||||
yield self.stream_response_to_bytes()
|
yield self.stream_response_to_bytes()
|
||||||
|
|||||||
Reference in New Issue
Block a user