Commit fae5fe66 authored by Ben Wang's avatar Ben Wang
Browse files

do per character loss aggregation for multiple choice tasks (similar to OAI's...

do per character loss aggregation for multiple choice tasks (similar to OAI's per token aggregation)
parent fd26ef16
......@@ -225,7 +225,9 @@ class MultipleChoiceTask(Task):
def process_results(self, doc, results):
gold = doc["gold"]
acc = 1. if np.argmax(results) == gold else 0.
completion_len = np.array([float(len(i)) for i in doc["choices"]])
acc = 1. if np.argmax(results/completion_len) == gold else 0.
return {
"acc": acc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment