Skip to content
Snippets Groups Projects
Commit 5e102482 authored by Colin Wang's avatar Colin Wang
Browse files

Update grading functions:

1. Fix the gpt-4o grader API version to avoid using the recently released one.
2. Fix grading API calling logics for reasoning Qs to increase robustness.
parent 6d225db5
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ def get_descriptive_result_gpt(client, prompt, length, max_retries=10):
"content": prompt,
}
],
model="gpt-4o",
model="gpt-4o-2024-05-13",
response_format={"type": "json_object"},
n=1,
max_tokens=max_tokens,
......
......@@ -16,7 +16,7 @@ def get_reasoning_result_gpt(client, prompt, max_retries=10):
"content": prompt,
}
],
model="gpt-4o",
model="gpt-4o-2024-05-13",
response_format={"type": "json_object"},
n=1,
max_tokens=max_tokens,
......@@ -33,6 +33,7 @@ def get_reasoning_result_gpt(client, prompt, max_retries=10):
if 'Unterminated string starting at' in str(e):
if max_tokens >= 1024:
print(f"Failed to get response for prompt: {prompt}")
ext, scr = 'Failed to parse response', -1
break
else:
max_tokens = min(1024, max_tokens * 2) # double the max_tokens
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment