Open junphine opened 1 year ago
使用T5Tokenizer替换AutoTokenizer,示例也是用的T5Tokenizer,使用AutoTokenizer会有下面的warning信息提示你为什么不能直接用AutoTokenizer。
UserWarning: The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas the sentencepiece version would have converted these unknown tokens into a sequence of byte tokens matching the original piece of text.
path = "/data/nlp/models/IDEA-CCNL/Randeng-T5-784M-QA-Chinese" tokenizer = AutoTokenizer.from_pretrained(path,trust_remote_code=True) mast_id = tokenizer.convert_tokens_to_ids("")
mast_id: 2
应该是词表最后100位之中