对modelscope的实体命名预训练模型进行微调上出现错误

按网上的例子,配置了train_config.yaml文件内容:
配置文件如下:
train:
work_dir: D:\GitHub\jupyter_notebook\forecast\ner\tmp
task: named-entity-recognition
dataset:
train: C:\Users\dingxn02\AppData\Local\Temp\tmpqt90wf17.jsonl
model: damo/nlp_raner_named-entity-recognition_chinese-base-cmeee
preprocessor: auto
trainer:
type: epoch_based
device: cpu
batch_size: 8
num_epochs: 3
learning_rate: 5e-5
logging_steps: 10
save_steps: 100

然后通过下述语句进行微调:

加载配置文件

config_file = 'train_config.yaml' # 确保此路径正确指向你的配置文件
config_file = 'D:\GitHub\jupyter_notebook\forecast\ner\tmp\train_config.yaml'
cfg = Config.from_file(config_file)

构建 Trainer 并开始训练

trainer = build_trainer(default_args=cfg.to_dict())
trainer.train()

提示错误:
AssertionError: EpochBasedTrainer: Config file should not be None if model is not from pretrained!

展开
收起
游客ieeecuqh5ljc4 2025-01-13 10:06:32 97 发布于北京 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 看起来你在配置文件中没有指定预训练模型的具体路径或标识符。请确保在配置文件中的model字段提供了正确的预训练模型地址或标识符,例如 damo/nlp_raner_named-entity-recognition_chinese-base-cmeee。如果还是有问题,可以直接询问阿里云客服,或者提交工单给阿里云的技术顾问,回答不易,麻烦大佬给个采纳,谢谢。

    2025-02-09 21:11:26 举报
    赞同 120 评论

    评论

    全部评论 (0)

    登录后可评论

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

热门讨论

热门文章

还有其他疑问?
咨询AI助理