write the app.py and upload data
Browse files
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."
|
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]
|