Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: The checkpoint you are trying to load has model type llava_mistral 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. #6781

Open
1 task done
dainini opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working pending This problem is yet to be addressed

Comments

@dainini
Copy link

dainini commented Jan 30, 2025

Reminder

  • I have read the above rules and searched the existing issues.

System Info

  • llamafactory version: 0.9.1
  • Platform: Linux-5.4.0-177-generic-x86_64-with-glibc2.31
  • Python version: 3.11.11
  • PyTorch version: 2.3.0+cu121 (GPU)
  • Transformers version: 4.45.2
  • Datasets version: 3.1.0
  • Accelerate version: 1.0.1
  • PEFT version: 0.12.0
  • TRL version: 0.9.6
  • GPU type: NVIDIA A100 80GB PCIe
  • DeepSpeed version: 0.14.0
  • Bitsandbytes version: 0.43.1
  • vLLM version: 0.5.0

Reproduction

llamafactory-cli train examples/train_lora/llavamed1_5_lora_dpo.yaml 
[2025-01-30 21:19:56,796] [INFO] [real_accelerator.py:191:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[INFO|2025-01-30 21:20:00] llamafactory.hparams.parser:355 >> Process rank: 0, device: cuda:0, n_gpu: 1, distributed training: False, compute dtype: torch.bfloat16
[INFO|configuration_utils.py:673] 2025-01-30 21:20:00,204 >> loading configuration file /hdd0/dain/models/llava-med-v1.5-mistral-7b/config.json
Traceback (most recent call last):
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 1023, in from_pretrained
    config_class = CONFIG_MAPPING[config_dict["model_type"]]
                   ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 725, in __getitem__
    raise KeyError(key)
KeyError: 'llava_mistral'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dain/.conda/envs/llama-factory/bin/llamafactory-cli", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/llamafactory/cli.py", line 112, in main
    run_exp()
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/llamafactory/train/tuner.py", line 56, in run_exp
    run_dpo(model_args, data_args, training_args, finetuning_args, callbacks)
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/llamafactory/train/dpo/workflow.py", line 43, in run_dpo
    tokenizer_module = load_tokenizer(model_args)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/llamafactory/model/loader.py", line 69, in load_tokenizer
    config = load_config(model_args)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/llamafactory/model/loader.py", line 119, in load_config
    return AutoConfig.from_pretrained(model_args.model_name_or_path, **init_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dain/.conda/envs/llama-factory/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 1025, in from_pretrained
    raise ValueError(
ValueError: The checkpoint you are trying to load has model type `llava_mistral` 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.

Others

No response

@dainini dainini added bug Something isn't working pending This problem is yet to be addressed labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant