File size: 3,171 Bytes
8947313
 
 
 
 
 
 
 
 
 
 
 
 
ab8d99d
8947313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ab8d99d
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
```CODE: 
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="EssentialAI/rnj-1-instruct")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
```

ERROR: 
Traceback (most recent call last):
  File "/tmp/EssentialAI_rnj-1-instruct_01TjqEM.py", line 26, in <module>
    pipe = pipeline("text-generation", model="EssentialAI/rnj-1-instruct")
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 1229, in pipeline
    return pipeline_class(model=model, framework=framework, task=task, **kwargs)
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 121, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1044, in __init__
    self.model.to(self.device)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4343, in to
    return super().to(*args, **kwargs)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1371, in to
    return self._apply(convert)
           ~~~~~~~~~~~^^^^^^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply
    module._apply(fn)
    ~~~~~~~~~~~~~^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply
    module._apply(fn)
    ~~~~~~~~~~~~~^^^^
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply
    module._apply(fn)
    ~~~~~~~~~~~~~^^^^
  [Previous line repeated 2 more times]
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 957, in _apply
    param_applied = fn(param)
  File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1357, in convert
    return t.to(
           ~~~~^
        device,
        ^^^^^^^
        dtype if t.is_floating_point() or t.is_complex() else None,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        non_blocking,
        ^^^^^^^^^^^^^
    )
    ^
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 64.00 MiB. GPU 0 has a total capacity of 22.30 GiB of which 62.69 MiB is free. Process 3735213 has 22.23 GiB memory in use. Of the allocated memory 21.99 GiB is allocated by PyTorch, and 617.50 KiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation.  See documentation for Memory Management  (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)