File size: 6,383 Bytes
cccefc8
 
 
 
 
 
 
 
 
 
 
 
 
3757636
cccefc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
```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_0F7FItQ.py", line 30, 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