Skip to content

Commit

Permalink
Merge pull request #201 from bigcode-project/issueprompt
Browse files Browse the repository at this point in the history
Add issue prompt
  • Loading branch information
loubnabnl authored Mar 1, 2024
2 parents 849481c + 1e4bb7e commit e54f33d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bigcode_eval/tasks/humanevalpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def __init__(self, prompt="instruct", language="python", with_docs=True):
elif self.prompt == "diff":
stop_words = ["<commit_before>", "<commit_msg>", "<commit_after>"]
elif self.prompt == "diff-carper":
stop_words = ["<BEF>", "<MSG>", "<DFF>", "\ No newline at end of file"]
stop_words = ["<BEF>", "<MSG>", "<DFF>", "\ No newline at end of file"]
elif self.prompt == "issue":
stop_words.append("```")
stop_words.append("<|endoftext|>")
self.with_docs = with_docs
super().__init__(stop_words=stop_words, requires_execution=True)
Expand Down Expand Up @@ -516,6 +518,8 @@ def get_prompt(self, doc):
elif self.prompt == "diff-carper":
prompt = f"<NME> {self.get_filename_with_extension(input_file=doc['entry_point'])}\n"
prompt += f"<BEF> {context}\n<MSG> {instruction}\n<DFF>"
elif self.prompt == "issue":
prompt = f"<issue_start>username_0: {instruction}\n\n```{context}```\nUpvotes: 100<issue_comment>username_1: Sure, here is the fixed code.\n\n```{prompt_base}"
else:
prompt = super().get_prompt(prompt_base, instruction, context)
return prompt.strip()
Expand Down

0 comments on commit e54f33d

Please sign in to comment.