transformers
67de05d9 - Guard heavy imports behind is_torch_available() — fixes tokenizer-only installs

Commit
126 days ago
Guard heavy imports behind is_torch_available() — fixes tokenizer-only installs `tokenization_utils_tokenizers` pulls in `load_gguf_checkpoint` from `modeling_gguf_pytorch_utils` even without torch. The arch-converter tables construct `WeightRenaming` / `WeightConverter` instances, which import torch transitively. Moved those imports + table construction inside an `if is_torch_available():` block so the module can still be loaded for tokenizer-only use cases.
Author
Parents
Loading