以t5-base为例:
储存模型:
from transformers import AutoModelForSeq2SeqLM if __name__ == '__main__': model_name = 't5-base' prefix = 'your_path' save_path = prefix+model_name model = AutoModelForSeq2SeqLM.from_pretrained(model_name) model.save_pretrained(save_path)
加载模型:
model = AutoModelForSeq2SeqLM.from_pretrained(save_path)
标签:__,name,本地化,huggingface,AutoModelForSeq2SeqLM,path,model,save From: https://www.cnblogs.com/huangshiyu13/p/17177037.html