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

[Feature] Add huggingface apply_chat_template #1098

Merged
merged 25 commits into from May 14, 2024

Conversation

Leymore
Copy link
Collaborator

@Leymore Leymore commented Apr 26, 2024

Motivation

Remove a large amount of redundant information from the HuggingFace model config or information that can be obtained from the HF cache, including but not limited to chat_template, max_seq_len, and so on.

Modification

Two new classes, HuggingFaceBaseModel and HuggingFacewithChatTemplate are introduced in opencompass/models/huggingface_above_v4_33.py.
Most of the model configs are rewritten.

BC-breaking (Optional)

Passing --accelerator via cli will become not usable.

"""PPL Inferencer."""
# flake8: noqa
# yapf: disable
"""LL Inferencer."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""LL Inferencer."""
"""LogLikelihood(LL) Inferencer."""

Copy link
Collaborator

@tonysy tonysy left a comment

Choose a reason for hiding this comment

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

Update the readme with more information about new HF classes, and give instructions on the --accelarator

Copy link
Collaborator

@tonysy tonysy left a comment

Choose a reason for hiding this comment

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

LGTM

@Leymore Leymore changed the title [Feature] Add huggingface above v4.33 [Feature] Add huggingface apply_chat_template May 14, 2024
@Leymore Leymore merged commit 7505b3c into open-compass:main May 14, 2024
9 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.

None yet

2 participants