code_execution_files / ByteDance_Ouro-2.6B_0.txt
ariG23498's picture
ariG23498 HF Staff
Upload ByteDance_Ouro-2.6B_0.txt with huggingface_hub
83e991d verified
```CODE:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ByteDance/Ouro-2.6B", trust_remote_code=True)
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages)
```
ERROR:
Traceback (most recent call last):
File "/tmp/ByteDance_Ouro-2.6B_0eR9i56.py", line 28, in <module>
pipe(messages)
~~~~^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 325, in __call__
return super().__call__(Chat(text_inputs), **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1467, in __call__
return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1474, in run_single
model_outputs = self.forward(model_inputs, **forward_params)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1374, in forward
model_outputs = self._forward(model_inputs, **forward_params)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 432, in _forward
output = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/generation/utils.py", line 2564, in generate
result = decoding_method(
self,
...<5 lines>...
**model_kwargs,
)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/generation/utils.py", line 2784, in _sample
outputs = self(**model_inputs, return_dict=True)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/utils/generic.py", line 918, in wrapper
output = func(self, *args, **kwargs)
File "/tmp/.cache/huggingface/modules/transformers_modules/ByteDance/Ouro_hyphen_2_dot_6B/3d18014259a08ee6fda0827f589bd3d8baed2438/modeling_ouro.py", line 477, in forward
outputs, hidden_states_list, gate_list = self.model(
~~~~~~~~~~^
input_ids=input_ids,
^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
**kwargs,
^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/utils/generic.py", line 1064, in wrapper
outputs = func(self, *args, **kwargs)
File "/tmp/.cache/huggingface/modules/transformers_modules/ByteDance/Ouro_hyphen_2_dot_6B/3d18014259a08ee6fda0827f589bd3d8baed2438/modeling_ouro.py", line 382, in forward
hidden_states = decoder_layer(
hidden_states,
...<7 lines>...
**kwargs,
)
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/modeling_layers.py", line 94, in __call__
return super().__call__(*args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/tmp/.cache/huggingface/modules/transformers_modules/ByteDance/Ouro_hyphen_2_dot_6B/3d18014259a08ee6fda0827f589bd3d8baed2438/modeling_ouro.py", line 228, in forward
hidden_states, _ = self.self_attn(
~~~~~~~~~~~~~~^
hidden_states=hidden_states,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
**kwargs,
^^^^^^^^^
)
^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/tmp/.cache/huggingface/modules/transformers_modules/ByteDance/Ouro_hyphen_2_dot_6B/3d18014259a08ee6fda0827f589bd3d8baed2438/modeling_ouro.py", line 156, in forward
key_states, value_states = past_key_value.update(key_states, value_states, current_ut * self.config.num_hidden_layers + self.layer_idx, cache_kwargs)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.cache/uv/environments-v2/a6d7d863ff8e79d1/lib/python3.13/site-packages/transformers/cache_utils.py", line 776, in update
keys, values = self.layers[layer_idx].update(key_states, value_states, cache_kwargs)
~~~~~~~~~~~^^^^^^^^^^^
IndexError: list index out of range