fix: prompt phi (#1845) [skip ci]

* corecting phi system prompt

* phi test

* update

* add test
This commit is contained in:
JohanWork
2024-08-22 17:46:57 +02:00
committed by GitHub
parent 9caa3eb699
commit 7ed92e61c2
2 changed files with 17 additions and 2 deletions

View File

@@ -65,8 +65,10 @@ class AlpacaPrompter(Prompter):
self.system_format = "<|im_start|>system\n{system}<|im_end|>\n"
elif self.prompt_style == PromptStyle.PHI.value:
self.turn_format = "<|user|>\n{instruction}<|end|>{input}<|assistant|>"
self.turn_no_input_format = "<|user|>\n{instruction}<|end|><|assistant|>"
self.system_format = "<|system|>{system}\n"
self.turn_no_input_format = (
"<|user|>\n{instruction}<|end|>\n<|assistant|>\n"
)
self.system_format = "<|system|>\n{system}<|end|>\n"
def _build_result(self, instruction, input_text, output):
# returns the full prompt from instruction and optional input