wlike commited on
Commit
2dc4998
·
verified ·
1 Parent(s): a538210

deal with exception

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -43,6 +43,8 @@ def predict(msg, history=[]):
43
  snippet = ""
44
  i = 0
45
  for chunk in response:
 
 
46
  i += 1
47
  if chunk.choices[0].delta.content is not None:
48
  snippet = snippet + chunk.choices[0].delta.content
 
43
  snippet = ""
44
  i = 0
45
  for chunk in response:
46
+ if chunk is None:
47
+ continue
48
  i += 1
49
  if chunk.choices[0].delta.content is not None:
50
  snippet = snippet + chunk.choices[0].delta.content