Repo id must use alphanumeric chars or ‘-‘, ‘_‘, ‘.‘, ‘--‘ and ‘..‘ are forbidden, ‘-‘ and ‘.‘ canno
·
问题:
python使用transformers时报错:
Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96
Repo ID必须使用字母数字字符或者'-'、'_'、'...',禁止使用'--'和'...','-'和'...'不能作为名称的开始或结束,最大长度为96。
解决方法:
Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96
发现是因为在代码中不小心把文件名mDeBERTa-v3-base-mnli-xnli中的"-"写成了"_"
,将代码中的"_"全部改为"-"后该错误消失。
from transformers import pipeline
model_name = r"D:\NLP\model\mDeBERTa-v3-base-mnli-xnli"
classifier = pipeline("zero-shot-classification", model=model_name)
虽然该错误说的是Repo ID必须使用字母数字字符或者'-'、'_'、'...',禁止使用'--'和'...','-'和'...'不能作为名称的开始或结束,但也可能是因为模型文件夹的名字写错了。
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐


所有评论(0)