Spaces:
Running
Running
yowenchen
commited on
Commit
β’
7872f9e
1
Parent(s):
bc3b8f5
fix
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def completion():
|
|
107 |
}, headers={"Authorization": f"Bearer {st.secrets['token']}"})
|
108 |
answer = resp.json()
|
109 |
for idx, choice in enumerate(answer['choices']):
|
110 |
-
if choice.get("finish_reason",
|
111 |
st.error(f'ηζη»ζ#{idx}εΊι: {choice["finish_reason"]}')
|
112 |
elif choice.get("text", None) is None:
|
113 |
st.error(f'ηζη»ζ#{idx}εΊι: ζ ηζη»ζ')
|
|
|
107 |
}, headers={"Authorization": f"Bearer {st.secrets['token']}"})
|
108 |
answer = resp.json()
|
109 |
for idx, choice in enumerate(answer['choices']):
|
110 |
+
if choice.get("finish_reason", None) != "finished":
|
111 |
st.error(f'ηζη»ζ#{idx}εΊι: {choice["finish_reason"]}')
|
112 |
elif choice.get("text", None) is None:
|
113 |
st.error(f'ηζη»ζ#{idx}εΊι: ζ ηζη»ζ')
|