akiko19191 commited on
Commit
ad2ec99
·
verified ·
1 Parent(s): 8337dcd

Update utils/llms.py

Browse files
Files changed (1) hide show
  1. utils/llms.py +3 -2
utils/llms.py CHANGED
@@ -157,10 +157,10 @@ def gpt4stream(messages,model,api_keys):
157
  )
158
  for part in response:
159
  cunk=cunk+(part.choices[0].delta.content or "")
160
- if "```json" not in cunk:
161
- helper.q.put_nowait(part.choices[0].delta.content or "")
162
  break
163
  except Exception as e:
 
164
  pass
165
  print("STOPPING")
166
  helper.q.put_nowait("RESULT: "+cunk)
@@ -185,6 +185,7 @@ def gpt4stream(messages,model,api_keys):
185
  helper.q.put_nowait(part.choices[0].delta.content or "")
186
  break
187
  except Exception as e:
 
188
  pass
189
  print("STOPPING")
190
  if "```json" in cunk:
 
157
  )
158
  for part in response:
159
  cunk=cunk+(part.choices[0].delta.content or "")
160
+ helper.q.put_nowait(part.choices[0].delta.content or "")
 
161
  break
162
  except Exception as e:
163
+ helper.q.put_nowait(str(e))
164
  pass
165
  print("STOPPING")
166
  helper.q.put_nowait("RESULT: "+cunk)
 
185
  helper.q.put_nowait(part.choices[0].delta.content or "")
186
  break
187
  except Exception as e:
188
+
189
  pass
190
  print("STOPPING")
191
  if "```json" in cunk: