name 'Kosmos2Tokenizer' is not defined

#9
by Aweminus - opened

Hi,

When I tried to run the inference code and used the following processor,
processor = AutoProcessor.from_pretrained("ydshieh/kosmos-2-patch14-224", trust_remote_code=True)

it would return this error,
NameError: name 'Kosmos2Tokenizer' is not defined

I also have a problem that if I try to run it locally by setting "trust_remote_code=False", it will return
ValueError: Loading /root/kosmos-2-patch14-224 requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

i'm having the same issue, "NameError: name 'Kosmos2Tokenizer' is not defined".
did u get this solved?

Hi, could you check if you have sentencepiece installed? If yes, what's its version?

Problem solved by

pip install sentencepiece

Thanks very much!

ydshieh changed discussion status to closed

Sign up or log in to comment