Skip to content

Commit

Permalink
update evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
mst272 committed Sep 18, 2024
1 parent 091a936 commit 05b658c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions evalueate/task/humaneval/humaneval.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def generate_one(example, lang, tokenizer, model, args):
def generate_main(args):
model_name_or_path = args.model_name_or_path
saved_path = args.output_path
temp_dir = args.temp_dir
os.makedirs(temp_dir, exist_ok=True)

print("model", model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
Expand Down Expand Up @@ -94,4 +92,5 @@ def evaluate_only(args):
if __name__ == '__main__':
parser = HfArgumentParser((EvaluateArgs,))
args = parser.parse_args_into_dataclasses()[0]
os.environ["TOKENIZERS_PARALLELISM"] = "false"
generate_main(args)
3 changes: 1 addition & 2 deletions evalueate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def extract_generation_code(example, lang_code):

try:
code_block: str = re.findall(f'```{lang.lower()}\n(.*?)```', output, re.DOTALL | re.IGNORECASE)[0]
assert code_block.startswith(prompt)
# assert code_block.startswith(prompt)
generation = code_block[len(prompt):]
example['generation'] = generation

Expand All @@ -34,4 +34,3 @@ def extract_generation_code(example, lang_code):
'full_name': 'Java'
}
}

0 comments on commit 05b658c

Please sign in to comment.