Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def generate_questions_with_retry(knowledge_material, question_type, cognitive_l
|
|
86 |
]
|
87 |
)
|
88 |
return response.choices[0].message.content
|
89 |
-
except openai.
|
90 |
retries += 1
|
91 |
time.sleep(2) # Wait for 2 seconds before retrying
|
92 |
if retries == max_retries:
|
|
|
86 |
]
|
87 |
)
|
88 |
return response.choices[0].message.content
|
89 |
+
except openai.APIConnectionError:
|
90 |
retries += 1
|
91 |
time.sleep(2) # Wait for 2 seconds before retrying
|
92 |
if retries == max_retries:
|