mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-07-16 10:03:25 -07:00
Fix json formatting issue with streaming
See this and the following comment for context: https://github.com/fauxpilot/fauxpilot/issues/1\#issuecomment-1357174072 Signed-off-by: Parth Thakkar <thakkarparth007@gmail.com>
This commit is contained in:
parent
7ebe8b6d5b
commit
566cf7a675
1 changed files with 2 additions and 2 deletions
|
@ -234,8 +234,8 @@ class CodeGenProxy:
|
||||||
for c in choices:
|
for c in choices:
|
||||||
completion['id'] = self.random_completion_id()
|
completion['id'] = self.random_completion_id()
|
||||||
completion['choices'] = [c]
|
completion['choices'] = [c]
|
||||||
yield f'data: {json.dumps(completion)}\n\n'
|
yield f'{json.dumps(completion)}\n\n'
|
||||||
yield 'data: [DONE]\n\n'
|
yield '[DONE]\n\n'
|
||||||
|
|
||||||
def non_streamed_response(self, completion, choices) -> str:
|
def non_streamed_response(self, completion, choices) -> str:
|
||||||
completion['id'] = self.random_completion_id()
|
completion['id'] = self.random_completion_id()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue