ariG23498 HF Staff commited on
Commit
9899f15
·
verified ·
1 Parent(s): 79f68b2

Upload tencent_HunyuanOCR_0.txt with huggingface_hub

Browse files
Files changed (1) hide show
  1. tencent_HunyuanOCR_0.txt +42 -0
tencent_HunyuanOCR_0.txt ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```CODE:
2
+ # Use a pipeline as a high-level helper
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("image-text-to-text", model="tencent/HunyuanOCR")
6
+ messages = [
7
+ {
8
+ "role": "user",
9
+ "content": [
10
+ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
11
+ {"type": "text", "text": "What animal is on the candy?"}
12
+ ]
13
+ },
14
+ ]
15
+ pipe(text=messages)
16
+ ```
17
+
18
+ ERROR:
19
+ Traceback (most recent call last):
20
+ File "/tmp/.cache/uv/environments-v2/cb3dfffd924b203e/lib/python3.13/site-packages/transformers/models/auto/configuration_auto.py", line 1360, in from_pretrained
21
+ config_class = CONFIG_MAPPING[config_dict["model_type"]]
22
+ ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
+ File "/tmp/.cache/uv/environments-v2/cb3dfffd924b203e/lib/python3.13/site-packages/transformers/models/auto/configuration_auto.py", line 1048, in __getitem__
24
+ raise KeyError(key)
25
+ KeyError: 'hunyuan_vl'
26
+
27
+ During handling of the above exception, another exception occurred:
28
+
29
+ Traceback (most recent call last):
30
+ File "/tmp/tencent_HunyuanOCR_0d0B5PL.py", line 26, in <module>
31
+ pipe = pipeline("image-text-to-text", model="tencent/HunyuanOCR")
32
+ File "/tmp/.cache/uv/environments-v2/cb3dfffd924b203e/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 922, in pipeline
33
+ config = AutoConfig.from_pretrained(
34
+ model, _from_pipeline=task, code_revision=code_revision, **hub_kwargs, **model_kwargs
35
+ )
36
+ File "/tmp/.cache/uv/environments-v2/cb3dfffd924b203e/lib/python3.13/site-packages/transformers/models/auto/configuration_auto.py", line 1362, in from_pretrained
37
+ raise ValueError(
38
+ ...<8 lines>...
39
+ )
40
+ ValueError: The checkpoint you are trying to load has model type `hunyuan_vl` 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.
41
+
42
+ 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`