Closed dibbla closed 2 months ago
Hey @dibbla !
I just tried your script and it didn't trigger any downloading process, the only process was loading checkpoint shards
. Can you make sure that the given directory exists and has the model checkpoints in it
Hey @dibbla !
I just tried your script and it didn't trigger any downloading process, the only process was
loading checkpoint shards
. Can you make sure that the given directory exists and has the model checkpoints in it
Thanks for the fast reply @zucchini-nlp
I just confirmed that the directory does contain the model files.
Code:
from transformers import AutoModelForVision2Seq, AutoTokenizer, AutoImageProcessor
import json
import PIL
import IPython.display as display
import torch
import os
model_name_or_path = "/root/xgen-mm-phi3-mini-base-r-v1.5/"
print(os.listdir(model_name_or_path))
model = AutoModelForVision2Seq.from_pretrained(model_name_or_path, trust_remote_code=True)
What I observe (it starts download):
['model-00002-of-00004.safetensors', 'added_tokens.json', 'image_processing_blip_3.py', 'README.md', 'preprocessor_config.json', 'icl_examples', 'special_tokens_map.json', 'model-00001-of-00004.safetensors', 'model-00003-of-00004.safetensors', 'generation_config.json', 'demo.ipynb', 'tokenizer.json', '.huggingface', '.gitattributes', 'config.json', 'model.safetensors.index.json', 'modeling_xgenmm.py', 'test_samples', 'tokenizer_config.json', 'model-00004-of-00004.safetensors']
model.safetensors: 14%|██████████████▌ | 482M/3.51G [00:09<48:00, 1.05MB/s]
Is there any differences between my directory and yours?
Hmm, yes, I have the same files under the directory. It is weird, can you verify that the loading goes through this path and ensures that the passed model_id
is a path?
Hmm, yes, I have the same files under the directory. It is weird, can you verify that the loading goes through this path and ensures that the passed
model_id
is a path?
Hi @zucchini-nlp
Problem solved, though not knowing why 🤔
I downloaded the main branch of transformers and install it from source, and things work fine. I also noticed that this issue affects not only blip3 but other models using transformers' autopipelines. It may have to do with the environment setting given I am using a VM.
Closing this issue and I might comment if I have time to further investigate
System Info
transformers
version: 4.43.3Who can help?
@zucchini-nlp @ArthurZucker @amyeroberts
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I am using the latest Salesforce/xgen-mm-phi3-mini-base-r-v1 for image captioning. To reproduce,
/root
)model_name_or_path = "/root/xgen-mm-phi3-mini-base-r-v1.5/" model = AutoModelForVision2Seq.from_pretrained(model_name_or_path, trust_remote_code=True)