Commit 1f63b3dc authored by Baber's avatar Baber
Browse files

fix

parent 6bc8b8cc
...@@ -7,10 +7,10 @@ doc_to_text: "Solve the following math problem efficiently and clearly:\n\n- For ...@@ -7,10 +7,10 @@ doc_to_text: "Solve the following math problem efficiently and clearly:\n\n- For
#process_results: !function utils.process_results #process_results: !function utils.process_results
doc_to_target: "{{answer if few_shot is undefined else solution}}" doc_to_target: "{{answer if few_shot is undefined else solution}}"
process_results: !function utils.process_results process_results: !function utils.process_results
repeats: 2 repeats: 64
generation_kwargs: generation_kwargs:
until: [] until: []
max_gen_toks: 1024 max_gen_toks: 32768
do_sample: true do_sample: true
top_p: 0.95 top_p: 0.95
temperature: 0.6 temperature: 0.6
......
...@@ -78,7 +78,7 @@ def process_results(docs: dict, resps: list[dict]) -> dict: ...@@ -78,7 +78,7 @@ def process_results(docs: dict, resps: list[dict]) -> dict:
return resps[0] return resps[0]
# calculate pass@1 for all results # calculate pass@1 for all results
def get_metric(predictions: list[list[str]], references: list[dict]) -> Dict[str, int]: def get_metric(predictions: list[list[str]], references: list[dict]) -> list[dict]:
res = [] res = []
for reference, candidates in zip(references, predictions): for reference, candidates in zip(references, predictions):
for candidate in candidates: for candidate in candidates:
...@@ -89,12 +89,12 @@ def get_metric(predictions: list[list[str]], references: list[dict]) -> Dict[str ...@@ -89,12 +89,12 @@ def get_metric(predictions: list[list[str]], references: list[dict]) -> Dict[str
retval = 1 retval = 1
results = { results = {
"accuracy": retval, "acc": retval,
} }
res.append(results) res.append(results)
break break
else: else:
res.append({"accuracy": 0}) res.append({"acc": 0})
return res return res
......
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