ValueError: The checkpoint you are trying to load has model type `hf_olmo` but Transformers does not recognize this architecture.

#1
by Rabrg - opened

When trying to load the DataDecide with the latest version of the transformers library, it's failing to identify the model config

Traceback (most recent call last):
  File "/home/ryan/code/compression/.venv/lib/python3.14/site-packages/transformers/models/auto/configuration_auto.py", line 1431, in from_pretrained
    config_class = CONFIG_MAPPING[config_dict["model_type"]]
                   ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/code/compression/.venv/lib/python3.14/site-packages/transformers/models/auto/configuration_auto.py", line 1134, in __getitem__
    raise KeyError(key)
KeyError: 'hf_olmo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ryan/code/compression/arithmetic_coding_encoder.py", line 280, in <module>
    main()
    ~~~~^^
  File "/home/ryan/code/compression/arithmetic_coding_encoder.py", line 276, in main
    run_encode(parse_args(argv))
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/ryan/code/compression/arithmetic_coding_encoder.py", line 27, in run_encode
    device, tokenizer, model = acs.load_model_and_tokenizer(
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        model_id=args.model_id,
        ^^^^^^^^^^^^^^^^^^^^^^^
        trust_remote_code=args.trust_remote_code,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/ryan/code/compression/arithmetic_coding_shared.py", line 188, in load_model_and_tokenizer
    model = AutoModelForCausalLM.from_pretrained(
        model_id,
    ...<2 lines>...
        device_map="cuda",
    )
  File "/home/ryan/code/compression/.venv/lib/python3.14/site-packages/transformers/models/auto/auto_factory.py", line 319, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        pretrained_model_name_or_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        **kwargs,
        ^^^^^^^^^
    )
    ^
  File "/home/ryan/code/compression/.venv/lib/python3.14/site-packages/transformers/models/auto/configuration_auto.py", line 1433, in from_pretrained
    raise ValueError(
    ...<8 lines>...
    )
ValueError: The checkpoint you are trying to load has model type `hf_olmo` 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.

Sign up or log in to comment