Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Phi 3 mini chat format #1383

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

reddiamond1234
Copy link

*my first PR :)

@handshape
Copy link

It's getting weird over on HF. MS has revised the Phi-3 chat format to completely ignore the system role, and are telling consumers to rewrite their prompt structures instead.

https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/discussions/51

@0cc4m
Copy link

0cc4m commented May 22, 2024

@abetlen Is there any way I can help? Would be nice to get the phi 3 format in, now that the larger models have been released.

@@ -1325,6 +1331,27 @@ def format_gemma(
_prompt = _format_no_colon_single(system_message="", messages=_messages, sep=_sep)
return ChatFormatterResponse(prompt=_prompt, stop=_sep)

@register_chat_format("phi_3_mini")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to call it just "phi-3" here and elsewhere

assistant="<|assistant|>",
system="<|system|>"
)
_begin_token = "<s>"
Copy link

@ihendley ihendley May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see <s> in the technical report. Are you sure you need this?

@RomainMendez
Copy link

Any success in merging this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants