deal with exception
Browse files
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
|