Qwen3 tokenizer fails to load in Transformers 5.3.0 even with sentencepiece/tiktoken installed

#33
by lha007 - opened

Hi, I’m running into a tokenizer loading failure when trying to load Qwen/Qwen3‑1.7B using Transformers 5.3.0.the tokenizer still fails with the following error:
ValueError: Couldn't instantiate the backend tokenizer from one of:
(1) a tokenizers library serialization file,
(2) a slow tokenizer instance to convert or
(3) an equivalent slow tokenizer class to instantiate and convert.
You need to have sentencepiece or tiktoken installed to convert a slow tokenizer to a fast one.
my loading codes:
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "Qwen/Qwen3-1.7B"

tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True
)

model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto",
trust_remote_code=True
)

I also tried:
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True,
use_fast=False
)

any solution?

Sign up or log in to comment