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

[OV]: Fixed inference after 4 bit weight compression #569

Merged
merged 5 commits into from
Feb 21, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion optimum/intel/openvino/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ def _from_pretrained(
else:
init_cls = cls

causal_model = init_cls(model=model, config=config, model_save_dir=model_cache_path.parent, **kwargs)
causal_model = init_cls(
model=model, config=config, model_save_dir=model_cache_path.parent, compile=not load_in_4bit, **kwargs
)
AlexKoff88 marked this conversation as resolved.
Show resolved Hide resolved

if load_in_4bit:
if not is_nncf_available():
Expand All @@ -609,6 +611,7 @@ def _from_pretrained(
)

_weight_only_quantization(causal_model, quantization_config)
causal_model.request = None
AlexKoff88 marked this conversation as resolved.
Show resolved Hide resolved
return causal_model


Expand Down
Loading