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

phi3 chat_template does not support system role #30606

Merged
merged 2 commits into from
May 2, 2024

Conversation

amitportnoy
Copy link
Contributor

What does this PR do?

Removes misleading example which uses the system role

Phi3 chat_template does not use that role.
See https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/tokenizer_config.json#L119

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@stevhliu @MKhalusova @ArthurZucker @younesbelkada

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM let's just make sure the CI is green 😉

@amitportnoy
Copy link
Contributor Author

LGTM let's just make sure the CI is green 😉

The test that fails doesn't make sense to me, as the model's output is not deterministic.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks @amitportnoy !
Can you just update the old expected output:

>>> print(text)
<s><|system|> You are a helpful digital assistant. Please provide safe, ethical and accurate information to the user.<|end|><|user|> Can you provide ways to eat combinations of bananas and dragonfruits?<|end|><|assistant|> Absolutely! Bananas and dragonfruits are both delicious fruits that can be combined in various ways to create tasty and nutrit

With the new one in the docstring?

@younesbelkada
Copy link
Contributor

The expected one should be (according to the CI failure trace):

    <s><|user|> 
    Can you provide ways to eat combinations of bananas and dragonfruits?<|end|> 
    <|assistant|> 
    Certainly! Bananas and dragonfruits can be combined in various delicious ways. Here are some ideas for eating combinations of bananas and

@amitportnoy
Copy link
Contributor Author

(tests passed)

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks !

@younesbelkada younesbelkada requested a review from ArthurZucker May 2, 2024 12:50
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Lgtm thanks

@ArthurZucker ArthurZucker merged commit 801894e into huggingface:main May 2, 2024
8 checks passed
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.

4 participants