"ImportError: Package `num2words` is required to run SmolVLM processor" getting this issue wwhile importing SmolVLM2 from AutoProcessor

#18
by aryachakraborty - opened

I have installed the transformer using the following command "pip install git+https://github.com/huggingface/[email protected]".
and using the following code to import the model ,

Screenshot 2025-03-16 125521.png

processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForImageTextToText.from_pretrained(
    model_path,
    torch_dtype=torch.bfloat16,
    _attn_implementation="flash_attention_2"
).to("cuda")```

it's showing the error mentioned in the title. Explicitly I have installed the 'num2words' package using pip, still same error is showing. 

is there a particular version I need to install ? (PS: I have restarted the runtime multiple times, that didn't work.

I modify the "lib/python3.12/site-packages/transformers/models/smolvlm/processing_smolvlm.py" file.
The line 48 show this:

image.png

These conditional isn't executing as true... so import "from num2words import num2words" before this line and it will work.

image.png
I'm also facing the issue. Any idea how to move ahead?

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment