Spaces:
Build error
Build error
Add sleep to avoid rate limits
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import re
|
| 4 |
import requests
|
|
@@ -102,6 +103,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 102 |
print("Fetched questions list is empty.")
|
| 103 |
return "Fetched questions list is empty or invalid format.", None
|
| 104 |
print(f"Fetched {len(questions_data)} questions.")
|
|
|
|
| 105 |
except requests.exceptions.RequestException as e:
|
| 106 |
print(f"Error fetching questions: {e}")
|
| 107 |
return f"Error fetching questions: {e}", None
|
|
|
|
| 1 |
import os
|
| 2 |
+
import time
|
| 3 |
import gradio as gr
|
| 4 |
import re
|
| 5 |
import requests
|
|
|
|
| 103 |
print("Fetched questions list is empty.")
|
| 104 |
return "Fetched questions list is empty or invalid format.", None
|
| 105 |
print(f"Fetched {len(questions_data)} questions.")
|
| 106 |
+
time.sleep(20) # To avoid running into rate limits
|
| 107 |
except requests.exceptions.RequestException as e:
|
| 108 |
print(f"Error fetching questions: {e}")
|
| 109 |
return f"Error fetching questions: {e}", None
|