zhangjf commited on
Commit
90e8131
1 Parent(s): 7d48f50

write the app.py and upload data

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -90,7 +90,7 @@ def ask(query, max_attempt_times=3):
90
  )["choices"][0]["message"]["content"]
91
  except Exception as e:
92
  print(e)
93
- if "You exceeded your current quota, please check your plan and billing details." in e:
94
  idx = openai.api_keys.index(openai.api_key)
95
  idx = (idx + 1) % len(openai.api_keys)
96
  openai.api_key = openai.api_keys[idx]
 
90
  )["choices"][0]["message"]["content"]
91
  except Exception as e:
92
  print(e)
93
+ if str(e) == "You exceeded your current quota, please check your plan and billing details.":
94
  idx = openai.api_keys.index(openai.api_key)
95
  idx = (idx + 1) % len(openai.api_keys)
96
  openai.api_key = openai.api_keys[idx]