侧边栏壁纸
博主头像
小鱼吃猫博客博主等级

你所热爱的,便是你的生活。

  • 累计撰写 114 篇文章
  • 累计创建 47 个标签
  • 累计收到 9 条评论

目 录CONTENT

文章目录
NLP

Module ‘XXX‘ doesn‘t exist on the Hugging Face Hub

小鱼吃猫
2023-10-09 / 0 评论 / 4 点赞 / 44 阅读 / 852 字

Module 'accuracy' doesn't exist on the Hugging Face Hub either.

问题:

Module 'accuracy' doesn't exist on the Hugging Face Hub either.
Module 'f1' doesn't exist on the Hugging Face Hub either.

原因

出现这个错误,主要在使用evaluate时,加载accuarcy,由于网络问题访问不到导致的。

acc_metric = evaluate.load("accuracy")

解决方案

  1. 下载对应的py文件,然后从本地加载
https://github.com/huggingface/datasets/tree/main/metrics
  1. 从本地加载评估模块
from datasets import load_metric
acc_metric = load_metric("./accuracy.py")
f1_metirc = load_metric("./f1.py")
4

评论区