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

support Megrez-3B-Omni and fix mask padding #12582

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

MeouSker77
Copy link
Contributor

@MeouSker77 MeouSker77 commented Dec 19, 2024

Description

support Megrez-3B-Omni and fix mask padding

2. User API changes

use transformers 4.45

from ipex_llm.transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
    path,
    trust_remote_code=True,
    load_in_low_bit='sym_int4',
    modules_to_not_convert=["vision"],
    attn_implementation="eager",
)
model = model.half().eval()
model = model.to('xpu')

...

response = model.chat(
    messages,
    sampling=True,     # necessary
    use_cache=True,    # important
    max_new_tokens=MAX_NEW_TOKENS,
    # temperature=0,
)

@MeouSker77 MeouSker77 requested a review from rnwang04 December 19, 2024 09:08
Copy link
Contributor

@rnwang04 rnwang04 left a comment

Choose a reason for hiding this comment

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

LGTM

@MeouSker77 MeouSker77 merged commit 3eeb02f into intel-analytics:main Dec 19, 2024
1 check passed
@MeouSker77 MeouSker77 deleted the support-megrezo branch December 19, 2024 09:23
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.

2 participants