Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
78313b3
1
Parent(s):
21ed356
update
Browse files- util/injection.py +3 -2
util/injection.py
CHANGED
@@ -42,7 +42,7 @@ def create_summary(group_name, label, occupation,row,proportion):
|
|
42 |
def invoke_retry(prompt, agent, parameters,string_input=False):
|
43 |
attempts = 0
|
44 |
delay = 2 # Initial delay in seconds
|
45 |
-
max_attempts =
|
46 |
|
47 |
while attempts < max_attempts:
|
48 |
try:
|
@@ -70,7 +70,8 @@ def invoke_retry(prompt, agent, parameters,string_input=False):
|
|
70 |
delay *= 2 # Exponential increase of the delay
|
71 |
attempts += 1
|
72 |
|
73 |
-
|
|
|
74 |
|
75 |
|
76 |
def calculate_avg_score(score_list):
|
|
|
42 |
def invoke_retry(prompt, agent, parameters,string_input=False):
|
43 |
attempts = 0
|
44 |
delay = 2 # Initial delay in seconds
|
45 |
+
max_attempts = 5 # Maximum number of retry attempts
|
46 |
|
47 |
while attempts < max_attempts:
|
48 |
try:
|
|
|
70 |
delay *= 2 # Exponential increase of the delay
|
71 |
attempts += 1
|
72 |
|
73 |
+
return -1
|
74 |
+
#raise Exception("Failed to complete the API call after maximum retry attempts.")
|
75 |
|
76 |
|
77 |
def calculate_avg_score(score_list):
|