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

@@ -42,6 +42,19 @@ class AlpacaPrompterTest(unittest.TestCase):
assert "USER:" not in res
assert "ASSISTANT:" not in res
def test_prompt_style_w_phi(self):
prompter = AlpacaPrompter(prompt_style=PromptStyle.PHI.value)
res = next(prompter.build_prompt("tell me a joke about the following"))
assert (
"""<|system|>
Below is an instruction that describes a task. Write a response that appropriately completes the request.<|end|>
<|user|>
tell me a joke about the following<|end|>
<|assistant|>
"""
== res
)
def test_prompt_style_w_chat(self):
prompter = AlpacaPrompter(prompt_style=PromptStyle.CHAT.value)
res = next(