yowenchen commited on
Commit
7872f9e
β€’
1 Parent(s): bc3b8f5
Files changed (1) hide show
  1. app.py +1 -1
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", "finished") != "finished":
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}ε‡Ίι”™: ζ— η”Ÿζˆη»“ζžœ')