是用XLNET迁移学习部署到公司内网无法连接网络
收藏
XLNET训练生成好后,在本地测试成功并部署到docker测试通过,但部署到公司内网时发现接口在:tokenizer = XLNetTokenizer.from_pretrained('chinese-xlnet-base') 这句话会报错,报错信息是:requests.exceptions.ConnectionError: HTTPSConnectionPool(host='paddlenlp.bj.bcebos.com', port=443): Max retries exceeded with url: /models/transformers/xlnet/chinese-xlnet-base-spiece.model (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -5] No address associated with hostname',))。
我分析的原因是我是内网无法调用该模型,因为百度给的接口是外网,百度能否提供下载这个模型的连接或有其他解决方案吗?
0
收藏
请登录后评论
PaddleNLP文档:https://paddlenlp.readthedocs.io/zh/latest/source/paddlenlp.transformers.xlnet.modeling.html
建议:
1.可能可以先在本地加载模型后把模型保存到文件夹下,然后上传文件夹到服务器
tokenizer.save_pretrained("./checkpoint")
model.save_pretrained("./checkpoint")
2.在服务器那再通过以下命令加载文件夹里的试试
tokenizer = XLNetTokenizer.from_pretrained("./checkpoint")
model = XLNetModel.from_pretrained("./checkpoint")