Is it really huggingface model?
#1
by
supercharge19
- opened
Is it compatible with transformers, really? Look at the error below:
>>> model = AutoModelForImageTextToText.from_pretrained("stepfun-ai/GOT-OCR-2.0-hf", device_map=device)
Traceback (most recent call last):
File "C:\Users\jawad\.env\llm\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1071, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jawad\.env\llm\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 773, in __getitem__
raise KeyError(key)
KeyError: 'got_ocr2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<python-input-7>", line 1, in <module>
model = AutoModelForImageTextToText.from_pretrained("stepfun-ai/GOT-OCR-2.0-hf", device_map=device)
File "C:\Users\jawad\.env\llm\Lib\site-packages\transformers\models\auto\auto_factory.py", line 526, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
pretrained_model_name_or_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
**kwargs,
^^^^^^^^^
)
^
File "C:\Users\jawad\.env\llm\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1073, in from_pretrained
raise ValueError(
...<8 lines>...
)
ValueError: The checkpoint you are trying to load has model type `got_ocr2` 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.
You can update Transformers with the command `pip install --upgrade transformers`. If this does not work, and the checkpoint is very new, then there may not be a release version that supports this model yet. In this case, you can get the most up-to-date code by installing Transformers from source with the command `pip install git+https://github.com/huggingface/transformers.git`
I got latest transformers:
>>> import transformers
>>> transformers.__version__
'4.48.3'
i got same error
Yes that's expected, it will be included in the next transformers version. For now if you want to use it you have to install transformers from source :). Hope that helps!
Building small packages is a pain, I'll just wait for next drop. Thanks
supercharge19
changed discussion status to
closed
just install from
pip install git+https://github.com/huggingface/transformers.git
and it work