Spaces:
Running
Running
Fix sleep bug
Browse files
app.py
CHANGED
@@ -208,13 +208,13 @@ def grade(file_obj, progress=gr.Progress()):
|
|
208 |
except:
|
209 |
# gpt4 may have token rate limit
|
210 |
num_sleep += 1
|
211 |
-
if num_sleep >
|
212 |
score = 0.0
|
213 |
grade_sample_run_complete = True
|
214 |
num_sleep = 0
|
215 |
continue
|
216 |
-
print("sleep
|
217 |
-
time.sleep(
|
218 |
|
219 |
|
220 |
if len(sample_grade['model']) >= j + 1:
|
|
|
208 |
except:
|
209 |
# gpt4 may have token rate limit
|
210 |
num_sleep += 1
|
211 |
+
if num_sleep > 12:
|
212 |
score = 0.0
|
213 |
grade_sample_run_complete = True
|
214 |
num_sleep = 0
|
215 |
continue
|
216 |
+
print("sleep 5s")
|
217 |
+
time.sleep(5)
|
218 |
|
219 |
|
220 |
if len(sample_grade['model']) >= j + 1:
|