Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Value4AI/gpv
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-yeh committed Sep 25, 2024
2 parents 7a9de7d + 77ea8dd commit a87f28b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gpv/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def measure_texts(self, texts: list[str], values: list[str]):

for value in values:
if agg[value]:
agg[value] = np.mean(agg[value])
agg[value] = np.mean(agg[value]).item()
else:
agg[value] = None
results["aggregated"] = agg
Expand Down Expand Up @@ -286,8 +286,8 @@ def measure_entities_rag(self, text: str, values: list[str], measurement_subject
subject_value2scores[measurement_subject] = value2scores

# Save value2scores
save_path = "value2scores_" + datetime.now().strftime("%Y-%m-%d_%H-%M-%S") + ".json"
with open(save_path, "w") as file:
json.dump(subject_value2scores, file, indent=4)
# save_path = "value2scores_" + datetime.now().strftime("%Y-%m-%d_%H-%M-%S") + ".json"
# with open(save_path, "w") as file:
# json.dump(subject_value2scores, file, indent=4)

return subject_value2avg_scores

0 comments on commit a87f28b

Please sign in to comment.