Zekun Wu
commited on
Commit
•
da04c4f
1
Parent(s):
2316f10
update
Browse files- util/evaluator.py +3 -2
util/evaluator.py
CHANGED
@@ -59,7 +59,7 @@ class evaluator:
|
|
59 |
"""
|
60 |
|
61 |
response = self.model.invoke(evaluation_prompt,temperature=0.8, max_tokens=60).strip()
|
62 |
-
#response = """
|
63 |
print(response)
|
64 |
try:
|
65 |
scores = json.loads(response)
|
@@ -71,7 +71,8 @@ class evaluator:
|
|
71 |
scores = json.loads(repaired_json)
|
72 |
except json.JSONDecodeError:
|
73 |
print("Failed to decode JSON response even after repair attempt. Skipping this batch.")
|
74 |
-
return
|
|
|
75 |
|
76 |
return self.validate_scores(scores)
|
77 |
|
|
|
59 |
"""
|
60 |
|
61 |
response = self.model.invoke(evaluation_prompt,temperature=0.8, max_tokens=60).strip()
|
62 |
+
#response = """{{"Factually Correct": 0.9,"Useful": 0.85,"Context Specific": 0.8,"User Specific": 0.75,"Provides Pluralism": 0.7}}"""
|
63 |
print(response)
|
64 |
try:
|
65 |
scores = json.loads(response)
|
|
|
71 |
scores = json.loads(repaired_json)
|
72 |
except json.JSONDecodeError:
|
73 |
print("Failed to decode JSON response even after repair attempt. Skipping this batch.")
|
74 |
+
return {"Factually Correct": -1,"Useful": -1,"Context Specific": -1,"User Specific":-1,"Provides Pluralism":-1}
|
75 |
+
|
76 |
|
77 |
return self.validate_scores(scores)
|
78 |
|