Skip to content

Inference time model loading issue #1

@krishnakanthnakka

Description

@krishnakanthnakka

Hello authors,

Can you please advise if I could load the model using AutoModel function similar to one used for InternVL2.5 like

model = AutoModel.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    use_flash_attn=True,
    trust_remote_code=True).eval().cuda()

It seems to throw an error about checkpoint file missing.

warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Downloading shards:   0%|                               | 0/7 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/workspace/CyclingQA/lib/models/spatialreasoner_r1.py", line 103, in <module>
  model = AutoModel.from_pretrained(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
  return model_class.from_pretrained(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/transformers/modeling_utils.py", line 3715, in from_pretrained
  resolved_archive_file, sharded_metadata = get_checkpoint_shard_files(
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py", line 1079, in get_checkpoint_shard_files
  cached_filename = cached_file(
                    ^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py", line 397, in cached_file
  raise EnvironmentError(f"Could not locate {full_filename} inside {path_or_repo_id}.")
OSError: Could not locate model-00001-of-00007.safetensors inside PLAN-Lab/SpatialReasoner-R1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions