You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
My own task or dataset (give details below)
Reproduction
Download the model locally but put it under a hash that is not the same as the one from the latest in the hub
Run this. Interestingly if you instantiate the tokenizer first and the model it works fine. The culprit is that the is_peft_available() branch of the logic will look for adapter_config.json file and it won't find it, so it will ask hub and in that process it overrides the refs/main file.
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained(
model_id,
local_files_only=True,
)
tokenizer = AutoTokenizer.from_pretrained(
model_id,
local_files_only=True,
)
Expected behavior
The code above to work, more importantly AutoModel.from_pretrained() to not change the content of refs/main file.