BAAI-DCAI / SpatialBot

The official repo for "SpatialBot: Precise Spatial Understanding with Vision Language Models.
MIT License
157 stars 10 forks source link

Error occured when running the QuickStart code #11

Closed jingyi-zhang closed 1 month ago

jingyi-zhang commented 1 month ago

Thanks for your wonderful project!!

I download the SpatialBot-3B from: https://huggingface.co/RussRobin/SpatialBot-3B/tree/main And met an error when running the quickstart code:

Traceback (most recent call last):
  File "/home/zjy/jingyi/project/SpatialBot/test_spatialbot.py", line 20, in <module>
    model = AutoModelForCausalLM.from_pretrained(
  File "/home/zjy/anaconda3/envs/bunny/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 520, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
  File "/home/zjy/anaconda3/envs/bunny/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1012, in from_pretrained
    raise ValueError(
ValueError: The checkpoint you are trying to load has model type `bunny-phi` but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

❯ pip list|grep transformers
transformers              4.45.0.dev0
RussRobin commented 1 month ago

Hi @jingyi-zhang

Sorry for the confusion. I've updated the files in a recent commit to fix the bug. Please download the updated config.json and modeling_bunny_phi.py.

Another quick note in quickstart codes:

# If 'Expected all tensors to be on the same device' error is thrown, uncomment the following line
# model.get_vision_tower().to('cuda')

Regards

jingyi-zhang commented 1 month ago

Thanks a lot! It works!!!