zhangjf commited on
Commit
ea32ef3
1 Parent(s): 8e3ee3f

support dynamic timeout

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -137,7 +137,7 @@ def askingChatGPT(qs, qas, min_interval_seconds=3, max_interval_seconds=15, max_
137
  retry_times = 0
138
  a = None
139
  while a is None and retry_times<max_retry_times:
140
- a = ask_(q, timeout=np.mean(sorted(history_elapsed_time)[:8])*2)
141
  retry_times += 1
142
 
143
  qas.append({"q":q, "a":a})
 
137
  retry_times = 0
138
  a = None
139
  while a is None and retry_times<max_retry_times:
140
+ a = ask_(q, timeout=max(max_interval_seconds,np.mean(sorted(history_elapsed_time)[:8])))
141
  retry_times += 1
142
 
143
  qas.append({"q":q, "a":a})