code_execution_files / allenai_olmOCR-2-7B-1025-FP8_0.txt
ariG23498's picture
ariG23498 HF Staff
Upload allenai_olmOCR-2-7B-1025-FP8_0.txt with huggingface_hub
5122b5a verified
```CODE:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-to-text", model="allenai/olmOCR-2-7B-1025-FP8")
```
ERROR:
Traceback (most recent call last):
File "/tmp/allenai_olmOCR-2-7B-1025-FP8_0J8aaLk.py", line 19, in <module>
pipe = pipeline("image-to-text", model="allenai/olmOCR-2-7B-1025-FP8")
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 1027, in pipeline
framework, model = infer_framework_load_model(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
adapter_path if adapter_path is not None else model,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
**model_kwargs,
^^^^^^^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/pipelines/base.py", line 293, in infer_framework_load_model
model = model_class.from_pretrained(model, **kwargs)
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/models/auto/modeling_auto.py", line 2289, in from_pretrained
return super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/models/auto/auto_factory.py", line 604, in from_pretrained
return model_class.from_pretrained(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/modeling_utils.py", line 277, in _wrapper
return func(*args, **kwargs)
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4881, in from_pretrained
hf_quantizer, config, dtype, device_map = get_hf_quantizer(
~~~~~~~~~~~~~~~~^
config, quantization_config, dtype, from_tf, from_flax, device_map, weights_only, user_agent
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/quantizers/auto.py", line 305, in get_hf_quantizer
config.quantization_config = AutoHfQuantizer.merge_quantization_configs(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
config.quantization_config, quantization_config
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/quantizers/auto.py", line 214, in merge_quantization_configs
quantization_config = AutoQuantizationConfig.from_dict(quantization_config)
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/quantizers/auto.py", line 140, in from_dict
return target_cls.from_dict(quantization_config_dict)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/utils/quantization_config.py", line 1398, in from_dict
return super().from_dict(config_dict, return_unused_kwargs=return_unused_kwargs, **kwargs)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/utils/quantization_config.py", line 122, in from_dict
config = cls(**config_dict)
File "/tmp/.cache/uv/environments-v2/d4fbfc53dd8322e0/lib/python3.13/site-packages/transformers/utils/quantization_config.py", line 1328, in __init__
raise ImportError(
"compressed_tensors is not installed and is required for compressed-tensors quantization. Please install it with `pip install compressed-tensors`."
)
ImportError: compressed_tensors is not installed and is required for compressed-tensors quantization. Please install it with `pip install compressed-tensors`.