Skip to content

Commit

Permalink
add timeout loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rayguan97 committed Nov 13, 2023
1 parent 952c99e commit 08e51de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def evaluate_by_chatgpt(data, output_entry, correctness_entry, gpt_model="gpt-4"
timeout=5)
break
except:
print("Timeout, retrying...")
time.sleep(5) # Wait for 5 seconds before retrying

output_text = response['choices'][0]['message']['content']
Expand Down Expand Up @@ -97,6 +98,7 @@ def check_same_by_chatgpt(data, output_entry, gpt_model="gpt-4", load_json=False

break
except:
print("Timeout, retrying...")
time.sleep(5) # Wait for 5 seconds before retrying


Expand Down

0 comments on commit 08e51de

Please sign in to comment.