model-metadata/code_execution_files
025k
1```CODE: 2# Use a pipeline as a high-level helper3from transformers import pipeline4 5pipe = pipeline("text-generation", model="EssentialAI/rnj-1-instruct")6messages = [7 {"role": "user", "content": "Who are you?"},8]9pipe(messages)10```11 12ERROR: 13Traceback (most recent call last):14 File "/tmp/EssentialAI_rnj-1-instruct_0cm62qV.py", line 26, in <module>15 pipe = pipeline("text-generation", model="EssentialAI/rnj-1-instruct")16 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 1229, in pipeline17 return pipeline_class(model=model, framework=framework, task=task, **kwargs)18 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 121, in __init__19 super().__init__(*args, **kwargs)20 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^21 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1044, in __init__22 self.model.to(self.device)23 ~~~~~~~~~~~~~^^^^^^^^^^^^^24 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4343, in to25 return super().to(*args, **kwargs)26 ~~~~~~~~~~^^^^^^^^^^^^^^^^^27 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1371, in to28 return self._apply(convert)29 ~~~~~~~~~~~^^^^^^^^^30 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply31 module._apply(fn)32 ~~~~~~~~~~~~~^^^^33 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply34 module._apply(fn)35 ~~~~~~~~~~~~~^^^^36 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 930, in _apply37 module._apply(fn)38 ~~~~~~~~~~~~~^^^^39 [Previous line repeated 2 more times]40 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 957, in _apply41 param_applied = fn(param)42 File "/tmp/.cache/uv/environments-v2/9ed1d8af37d02702/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1357, in convert43 return t.to(44 ~~~~^45 device,46 ^^^^^^^47 dtype if t.is_floating_point() or t.is_complex() else None,48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^49 non_blocking,50 ^^^^^^^^^^^^^51 )52 ^53torch.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 1538371 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)54 