bugfix
This commit is contained in:
parent
8b57dadd04
commit
4bc140bafe
@ -97,6 +97,10 @@ class BaseProcessor(AppLogger):
|
||||
if self.retResponse is not None:
|
||||
self.set_response_headers(self.retResponse)
|
||||
return self.retResponse
|
||||
elif isinstance(self.content, Response):
|
||||
return self.content
|
||||
elif isinstance(self.content, StreamResponse):
|
||||
return self.content
|
||||
elif isinstance(self.content, DictObject):
|
||||
self.content = json.dumps(self.content, indent=4)
|
||||
jsonflg = True
|
||||
|
@ -41,7 +41,7 @@ class StreamLlmProxy:
|
||||
if '[DONE]' in ll:
|
||||
return
|
||||
try:
|
||||
print('write_chunk(),l=', ll)
|
||||
# print('write_chunk(),l=', ll)
|
||||
l = self.line_chunk_match(ll)
|
||||
d = DictObject(** json.loads(l))
|
||||
j = {}
|
||||
@ -66,6 +66,7 @@ class StreamLlmProxy:
|
||||
print_exc()
|
||||
|
||||
async def stream_handle(self, chunk):
|
||||
print('chunk=', chunk)
|
||||
chunk = chunk.decode('utf-8')
|
||||
chunk = self.remain_str + chunk
|
||||
lines = chunk.split('\n')
|
||||
|
Loading…
Reference in New Issue
Block a user