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

[Models] Add Phi3 to tests #776

Merged
merged 12 commits into from
May 3, 2024

Conversation

riedgar-ms
Copy link
Collaborator

Phi3 is now out, so start adding it into our testing frameworks

@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.60%. Comparing base (acb38d1) to head (b29ad1e).
Report is 208 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #776      +/-   ##
==========================================
+ Coverage   55.37%   62.60%   +7.22%     
==========================================
  Files          55       55              
  Lines        4074     4070       -4     
==========================================
+ Hits         2256     2548     +292     
+ Misses       1818     1522     -296     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@riedgar-ms riedgar-ms requested a review from Harsha-Nori April 23, 2024 22:42
@BardiaKh
Copy link

Hi,
I am also interested in trying out Phi-3. I see that you used the default TransformerChat class, however that is not the chat template the model was trained with.
Any chance you could get the chat template to work?

Here is my code:

class Phi3Chat(TransformersChat, Transformers):
    """ A HuggingFace transformers version of the Phi-3 Chat language model with Guidance support.
    """
    def get_role_start(self, role_name, **kwargs):
        role_dict = {
            'user': "<|user|>\n",
            'assistant': "<|assistant|>\n",
            'system': "<|system|>\n"
        }
        return role_dict.get(role_name, '')
    
    def get_role_end(self, role_name=None):
        role_dict = {
            'user': "<|end|>\n",
            'assistant': "<|end|>\n",
            'system': "<|end|>\n"
        }
        return role_dict.get(role_name, '')

But this leads to tokenization error.

@Harsha-Nori Harsha-Nori merged commit 07aa1bb into guidance-ai:main May 3, 2024
29 of 30 checks passed
@riedgar-ms riedgar-ms deleted the riedgar-ms/phi3-llm-testing branch May 3, 2024 15:00
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