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")
解决方案
- 下载对应的py文件,然后从本地加载
https://github.com/huggingface/datasets/tree/main/metrics
- 从本地加载评估模块
from datasets import load_metric
acc_metric = load_metric("./accuracy.py")
f1_metirc = load_metric("./f1.py")
评论区