Skip to content

Some errors about loading the model: Can not find 'adapter_config.json' and 'huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name':' #75

Description

@Yangxinyee

When I tried to load the model locally, I used the code below:

model_path = "MONAI/Llama3-VILA-M3-13B"
model_path = snapshot_download(model_path)
model_name = get_model_name_from_path(model_path)
tokenizer, model, image_processor, context_len = load_pretrained_model(
    model_path,
    model_name
)

Download successful. I am sure that the downloaded version is the same as the one on hugging face.
However...
Here is the log:
TypeError: load_pretrained_model() missing 1 required positional argument: 'model_name'

And then I modified the code like this:

model_path = "MONAI/Llama3-VILA-M3-8B"
model_path = snapshot_download(model_path)
model_base = model_path + "/" + "llm"
model_name = get_model_name_from_path(model_path)
tokenizer, model, image_processor, context_len = load_pretrained_model(
    model_path,
    model_base,
    model_name
)

Here is the error:

[2025-04-20 14:03:20,295] [INFO] [real_accelerator.py:161:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Fetching 21 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21/21 [00:00<00:00, 15971.06it/s]
/home/brownradx/.cache/huggingface/hub/models--MONAI--Llama3-VILA-M3-8B/snapshots/df60e0276e2ae10624c86dabe909847a03b2a5cb
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:05<00:00,  1.38s/it]
Loading LoRA weights from /home/brownradx/.cache/huggingface/hub/models--MONAI--Llama3-VILA-M3-8B/snapshots/df60e0276e2ae10624c86dabe909847a03b2a5cb
Traceback (most recent call last):
  File "/home/brownradx/miniconda3/envs/vila/lib/python3.10/site-packages/peft/config.py", line 260, in _get_peft_type
    config_file = hf_hub_download(
  File "/home/brownradx/miniconda3/envs/vila/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "/home/brownradx/miniconda3/envs/vila/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/home/brownradx/.cache/huggingface/hub/models--MONAI--Llama3-VILA-M3-8B/snapshots/df60e0276e2ae10624c86dabe909847a03b2a5cb'. Use `repo_type` argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/brownradx/Documents/Xinye_projects/vila/backend/model_runner.py", line 15, in <module>
    tokenizer, model, image_processor, context_len = load_pretrained_model(
  File "/home/brownradx/Documents/Xinye_projects/LLaVA/llava/model/builder.py", line 130, in load_pretrained_model
    model = PeftModel.from_pretrained(model, model_path)
  File "/home/brownradx/miniconda3/envs/vila/lib/python3.10/site-packages/peft/peft_model.py", line 439, in from_pretrained
    PeftConfig._get_peft_type(
  File "/home/brownradx/miniconda3/envs/vila/lib/python3.10/site-packages/peft/config.py", line 266, in _get_peft_type
    raise ValueError(f"Can't find '{CONFIG_NAME}' at '{model_id}'")
ValueError: Can't find 'adapter_config.json' at '/home/brownradx/.cache/huggingface/hub/models--MONAI--Llama3-VILA-M3-8B/snapshots/df60e0276e2ae10624c86dabe909847a03b2a5cb'

Two errors:

  1. Can not find 'adapter_config.json'.
  2. huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/home/brownradx/.cache/huggingface/hub/models--MONAI--Llama3-VILA-M3-8B/snapshots/df60e0276e2ae10624c86dabe909847a03b2a5cb'. Use repo_type argument if needed.

What should I do about it?
Did I miss the file adapter_config.json or it's something else that I didn't notice?

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