Skip to content

Support saving inc model for transformers-like api #2231

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Kaihui-intel
Copy link
Contributor

Type of Change

feature

Description

Target: Saving INC model before replace linear.
Implementation: Add parameter for_inference to from_pretrained().

Usage:

        woq_config = RtnConfig(bits=4, group_size=16)
        woq_model = AutoModelForCausalLM.from_pretrained(
            model_name_or_path,
            quantization_config=woq_config,
            for_inference=False,
        )

        # save
        output_dir = "./transformers_tmp"
        woq_model.save_pretrained(output_dir)

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed

@Kaihui-intel Kaihui-intel requested review from XuehaoSun and xin3he July 14, 2025 07:48
Signed-off-by: Kaihui-intel <[email protected]>
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