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

[One Shot] Default to AutoModel loading in OBCQ script #1891

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all 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
8 changes: 7 additions & 1 deletion src/sparseml/transformers/sparsification/obcq/obcq.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ def one_shot(
model_loader_fn = SparseCausalLM.auto_model_from_pretrained
forward_fn = llama_forward
else:
raise ValueError(f"model_path={model_path} should be one of {SUPPORTED_MODELS}")
_LOGGER.warning(
f"A supported model type({SUPPORTED_MODELS}) could not be "
f"parsed from model_path={model_path}. Defaulting to "
"AutoModelForCausalLM loading. "
)
model_loader_fn = SparseCausalLM.auto_model_from_pretrained
forward_fn = llama_forward
torch_dtype = _parse_dtype(precision)
model = model_loader_fn(
model_path, sequence_length=sequence_length, torch_dtype=torch_dtype
Expand Down
Loading