dfa32412 commited on
Commit
98e086f
·
verified ·
1 Parent(s): 719abe5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -146,7 +146,7 @@ async def yield_openai_chunks(response: httpx.Response):
146
  buffer = buffer[index + 1:]
147
 
148
  if content.startswith("0:"):
149
- content = content[2:].strip('"').replace("\\n","\n").replace('\\"','"').replace("\\\\","\\")
150
  data = {"id":"123456-456789-123456","object":"chat.completion.chunk","choices":[{"delta":{"content":content},"index":0,"finish_reason":None}]}
151
  yield "data: " + json.dumps(data) + "\n\n"
152
  else:
 
146
  buffer = buffer[index + 1:]
147
 
148
  if content.startswith("0:"):
149
+ content = content[2:][1:-1].replace("\\n","\n").replace('\\"','"').replace("\\\\","\\")
150
  data = {"id":"123456-456789-123456","object":"chat.completion.chunk","choices":[{"delta":{"content":content},"index":0,"finish_reason":None}]}
151
  yield "data: " + json.dumps(data) + "\n\n"
152
  else: