Text Generation
Transformers
Safetensors
PyTorch
nemotron_h
nvidia
conversational
custom_code
Eval Results

Was getting this error:

[transformers] `torch_dtype` is deprecated! Use `dtype` instead!
[transformers] The fast path is not available because one of `(selective_state_update, causal_conv1d_fn, causal_conv1d_update)` is None. Falling back to the naive implementation. To install follow https://github.com/state-spaces/mamba/#installation and https://github.com/Dao-AILab/causal-conv1d
Loading weights: 100%|x| 401/401 [06:51<00:00,  1.03s/it]
Traceback (most recent call last):
  File "/home/spark/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/.venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 289, in __getattr__
    return self.data[item]
           ~~~~~~~~~^^^^^^
KeyError: 'shape'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/spark/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/main0.py", line 23, in <module>
    outputs = model.generate(
              ^^^^^^^^^^^^^^^
  File "/home/spark/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/.venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/spark/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/.venv/lib/python3.12/site-packages/transformers/generation/utils.py", line 2534, in generate
    batch_size = inputs_tensor.shape[0]
                 ^^^^^^^^^^^^^^^^^^^
  File "/home/spark/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/.venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 291, in __getattr__
    raise AttributeError
AttributeError

Changing to the following fixed it:

outputs = model.generate(
    **tokenized_chat,
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment