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
Using distributed or parallel set-up in script?: no
Who can help?
No response
Information
The official example scripts
My own modified scripts
Tasks
An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
My own task or dataset (give details below)
Reproduction
clone model repo (flan-t5-large)
remove model.safetensors from target directory
run code
from transformers import AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_pretrained(
pretrained_model_name_or_path="path/to/flan-t5-large",
local_files_only=True,
use_safetensors=True
)
observe from_pretrained falls back to the pytorch_model.bin file and loads the model
Expected behavior
from_pretrained function should raise an error since no safetensors file is present in the target. If this is the target behavior, perhaps this is a feature request rather than a bug, but I find this to be misleading at best or unsafe at worst. Additionally, it is unclear how to manually direct the from_pretrained function to only load models with a specific name and extension, or to do so with a file loaded using the safetensors library. It is unclear to the user how a model file is chosen from the dir, so at the very minimum, a user should be able to declare the safetensors file themselves as the model file.
The text was updated successfully, but these errors were encountered:
System Info
transformers
version: 4.41.2Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
model.safetensors
from target directoryfrom_pretrained
falls back to thepytorch_model.bin
file and loads the modelExpected behavior
from_pretrained
function should raise an error since no safetensors file is present in the target. If this is the target behavior, perhaps this is a feature request rather than a bug, but I find this to be misleading at best or unsafe at worst. Additionally, it is unclear how to manually direct thefrom_pretrained
function to only load models with a specific name and extension, or to do so with a file loaded using the safetensors library. It is unclear to the user how a model file is chosen from the dir, so at the very minimum, a user should be able to declare the safetensors file themselves as the model file.The text was updated successfully, but these errors were encountered: