Baichuan2 icon indicating copy to clipboard operation
Baichuan2 copied to clipboard

ValueError: Tokenizer class BaichuanTokenizer does not exist or is not currently imported.

Open 98765mm opened this issue 1 year ago • 4 comments

when i use local model, it will happen ValueError: Tokenizer class BaichuanTokenizer does not exist or is not currently imported.

so,what should i do

98765mm avatar Sep 18 '23 09:09 98765mm

I meet the same error, how should I do?

tuxiangxianzhe avatar Sep 19 '23 02:09 tuxiangxianzhe

I solved this problem. If I load tokenizer with "tokenizer = AutoTokenizer.from_pretrained("./Baichuan2-7B-Chat-4bits/", use_fast=False)", this error will happen. While if I use "tokenizer = AutoTokenizer.from_pretrained("./Baichuan2-7B-Chat-4bits/", use_fast=False, trust_remote_code=True)", it runs successfully.

tuxiangxianzhe avatar Sep 19 '23 03:09 tuxiangxianzhe

You should use tokenizer.save_pretrained('YOUR_PATH') to save the tokenizer as well as the model.

whn09 avatar Nov 09 '23 02:11 whn09

I solved this problem. If I load tokenizer with "tokenizer = AutoTokenizer.from_pretrained("./Baichuan2-7B-Chat-4bits/", use_fast=False)", this error will happen. While if I use "tokenizer = AutoTokenizer.from_pretrained("./Baichuan2-7B-Chat-4bits/", use_fast=False, trust_remote_code=True)", it runs successfully.

met the same problem, already has trust_remote_code as True

wangdong2023 avatar Jan 11 '24 11:01 wangdong2023