-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Open
Labels
Description
System Info
API requests are made despite setting local_files_only=True when loading a pretrained tokenizers.
Here is the relevant part of the code that triggers the requests.
transformers/src/transformers/tokenization_utils_tokenizers.py
Lines 1199 to 1211 in 9495ae2
| def is_base_mistral(model_id: str) -> bool: | |
| model = model_info(model_id) | |
| if model.tags is not None: | |
| if re.search("base_model:.*mistralai", "".join(model.tags)): | |
| return True | |
| return False | |
| if is_offline_mode(): | |
| is_local = True | |
| if pretrained_model_name_or_path is not None and ( | |
| is_local or (not is_local and is_base_mistral(pretrained_model_name_or_path)) | |
| ): |
model_info inside is_base_mistral triggers this.
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained("Qwen/Qwen3-30B-A3B", local_files_only=True)Expected behavior
There should be no network requests being made with local_files_only=True.
vaibhav-research