Spaces:
Sleeping
Sleeping
IliaLarchenko
commited on
Commit
•
fbe4613
1
Parent(s):
5d590b7
Grader logging improvements
Browse files- tests/grader.py +3 -2
tests/grader.py
CHANGED
@@ -5,7 +5,7 @@ from openai import OpenAI
|
|
5 |
from tests.testing_prompts import grader_prompt
|
6 |
|
7 |
|
8 |
-
def grade(json_file_path, model="gpt-4-turbo"):
|
9 |
client = OpenAI(base_url="https://api.openai.com/v1")
|
10 |
|
11 |
with open(json_file_path) as file:
|
@@ -34,6 +34,7 @@ def grade(json_file_path, model="gpt-4-turbo"):
|
|
34 |
feedback["file_name"] = json_file_path
|
35 |
feedback["agent_llm"] = interview_data["interviewer_llm"]
|
36 |
feedback["candidate_llm"] = interview_data["candidate_llm"]
|
|
|
37 |
feedback["type"] = interview_data["inputs"]["interview_type"]
|
38 |
feedback["difficulty"] = interview_data["inputs"]["difficulty"]
|
39 |
feedback["topic"] = interview_data["inputs"]["topic"]
|
@@ -48,7 +49,7 @@ def grade(json_file_path, model="gpt-4-turbo"):
|
|
48 |
feedback["overall_score"] = sum(scores) / len(scores)
|
49 |
|
50 |
# save results to json file in the same folder as the interview data
|
51 |
-
with open(json_file_path.replace(".json", "
|
52 |
json.dump(feedback, file, indent=4)
|
53 |
|
54 |
return feedback
|
|
|
5 |
from tests.testing_prompts import grader_prompt
|
6 |
|
7 |
|
8 |
+
def grade(json_file_path, model="gpt-4-turbo", suffix=""):
|
9 |
client = OpenAI(base_url="https://api.openai.com/v1")
|
10 |
|
11 |
with open(json_file_path) as file:
|
|
|
34 |
feedback["file_name"] = json_file_path
|
35 |
feedback["agent_llm"] = interview_data["interviewer_llm"]
|
36 |
feedback["candidate_llm"] = interview_data["candidate_llm"]
|
37 |
+
feedback["grader_model"] = model
|
38 |
feedback["type"] = interview_data["inputs"]["interview_type"]
|
39 |
feedback["difficulty"] = interview_data["inputs"]["difficulty"]
|
40 |
feedback["topic"] = interview_data["inputs"]["topic"]
|
|
|
49 |
feedback["overall_score"] = sum(scores) / len(scores)
|
50 |
|
51 |
# save results to json file in the same folder as the interview data
|
52 |
+
with open(json_file_path.replace(".json", f"_feedback_{suffix}.json"), "w") as file:
|
53 |
json.dump(feedback, file, indent=4)
|
54 |
|
55 |
return feedback
|