support dynamic timeout
Browse files
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])
|
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})
|