Skip to content

Commit

Permalink
Merge pull request #199 from bigcode-project/addprompts
Browse files Browse the repository at this point in the history
Add prompts
  • Loading branch information
Muennighoff authored Feb 17, 2024
2 parents 2ec0159 + 649d82b commit 849481c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bigcode_eval/tasks/humanevalpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def get_prompt(self, prompt_base, instruction, context=None):
elif self.prompt == "octogeex":
prompt = f'Question: {inp.strip()}\n\nAnswer:\n{prompt_base}'
elif self.prompt == "starchat":
# https://huggingface.co/HuggingFaceH4/starchat-beta
# https://hf.co/HuggingFaceH4/starchat-beta
prompt = f'<|system|>\n<|end|>\n<|user|>\n{inp}<|end|>\n<|assistant|>\n{prompt_base}'
elif self.prompt == "starcodercommit":
prompt = f'<commit_before><commit_msg>{inp}<commit_after>{prompt_base}'
Expand All @@ -224,7 +224,17 @@ def get_prompt(self, prompt_base, instruction, context=None):
# https://github.com/nlpxucan/WizardLM/blob/main/WizardCoder/src/humaneval_gen.py#L37
prompt = f'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{inp}\n\n### Response:\n{prompt_base}'
elif self.prompt == "codellama":
# https://hf.co/codellama
prompt = f"[INST] {inp.strip()} [/INST] {prompt_base}"
elif self.prompt in ["tulu", "gritlm"]:
# https://hf.co/GritLM/GritLM-7B
prompt = f"<|user|>\n{inp}\n<|assistant|>\n{prompt_base}"
elif self.prompt == "zephyr":
# https://hf.co/HuggingFaceH4/zephyr-7b-beta
prompt = f"<|user|>\n{inp}</s>\n<|assistant|>\n{prompt_base}"
elif self.prompt == "yi":
# https://hf.co/01-ai/Yi-34B-Chat
prompt = f"<|im_start|>user\n{inp}<|im_end|>\n<|im_start|>assistant\n{prompt_base}"
elif self.prompt == "codellama-70b":
prompt = f"Source: user\n\n {inp.strip()} Source: assistant\nDestination: user \n\n{prompt_base}"
else:
Expand Down

0 comments on commit 849481c

Please sign in to comment.