Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Elfsong committed Apr 14, 2024
1 parent 4b1c8fc commit 3c5cb6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ evaluation*.json
generations*.json

playground/
mecury_eval.sh
6 changes: 3 additions & 3 deletions bigcode_eval/tasks/mercury.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Mercury(Task):

def __init__(self, prompt):
super().__init__(
stop_words=["\nclass", "\ndef", "\n#", "\n@", "\nprint", "\nif", "\n```", "<file_sep>"],
stop_words=["\nclass", "\ndef", "\n#", "\n@", "\nprint", "\nif", "\n```", "<file_sep>", "<|end▁of▁sentence|>"],
requires_execution=True,
)
self.prompt = prompt
Expand All @@ -58,8 +58,8 @@ def postprocess_generation(self, generation, idx):
"""
prompt = self.get_prompt(self.get_dataset()[idx])
generation = generation[len(prompt):]
print(generation)
return self._stop_at_stop_token(generation, self.stop_words)
generation = self._stop_at_stop_token(generation, self.stop_words)
return generation

def process_results(self, generations, references):
"""Takes the list of LM generations and evaluates them against ground truth references,
Expand Down

0 comments on commit 3c5cb6e

Please sign in to comment.