Open nuo-o opened 1 year ago
考虑到服务器不能连接外网,需要加载已经下载好的本地模型。执行以下代码的时候,会报错:TypeError: not a string
from transformers import AutoTokenizer, AutoModel from transformers import T5Tokenizer, T5ForConditionalGeneration import os model_dir="./model/ChatYuan-large-v2/" tokenizer = T5Tokenizer.from_pretrained(model_dir)
可能是环境问题,换一个机器试试看
考虑到服务器不能连接外网,需要加载已经下载好的本地模型。执行以下代码的时候,会报错:TypeError: not a string
from transformers import AutoTokenizer, AutoModel from transformers import T5Tokenizer, T5ForConditionalGeneration import os model_dir="./model/ChatYuan-large-v2/" tokenizer = T5Tokenizer.from_pretrained(model_dir)