Skip to content

Commit

Permalink
default to autoloading (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satrat committed Dec 11, 2023
1 parent b8030b1 commit 568bb41
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 568bb41

Please sign in to comment.