whyu commited on
Commit
32530a5
1 Parent(s): 0b0d73f

Fix sleep bug

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 > 2:
212
  score = 0.0
213
  grade_sample_run_complete = True
214
  num_sleep = 0
215
  continue
216
- print("sleep 30s")
217
- time.sleep(30)
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: