huggingface tokenizer本地化

以t5-base为例

本地存储:

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('t5-base')
tokenizer.save_pretrained('your_path')

本地加载:

tokenizer = AutoTokenizer.from_pretrained('your_path')

 

posted @ 2023-03-03 20:32  Shiyu_Huang  阅读(864)  评论(0编辑  收藏  举报