Skip to content
Closed
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
5 changes: 5 additions & 0 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4545,6 +4545,11 @@ def from_pretrained(
if gguf_file is not None and not is_accelerate_available():
raise ValueError("accelerate is required when loading a GGUF file `pip install accelerate`.")

if kernel_config is not None and not use_kernels:
raise ValueError(
"kernel_config is only supported when use_kernels is set to True, please set use_kernels to True or remove kernel_config."
)

if commit_hash is None:
if not isinstance(config, PreTrainedConfig):
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
Expand Down