Getting error when I try to run the example code

#4
by rajeshjaluka - opened

I used the example code on this page https://huggingface.co/ibm-granite/granite-4.0-tiny-preview

First, I got error that it is complied using numpy 1.x, I downgraded to get past the error.

Now, I am getting the following error

File "/Users/xxx/.granite/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 1131, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/.granite/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 833, in getitem
raise KeyError(key)
KeyError: 'granitemoehybrid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/xxx/test.py", line 6, in
model = AutoModelForCausalLM.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/.granite/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 531, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/.granite/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 1133, in from_pretrained
raise ValueError(
ValueError: The checkpoint you are trying to load has model type granitemoehybrid 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.

I will appreciate some help.

Sign up or log in to comment