I am developing a dataset and accompanying custom metric at cpllab/syntaxgym at main.
I can load my custom dataset with e.g. datasets.load_dataset("cpllab/syntaxgym", "subordination_src-src")
.
But I cannot load my metric with the same Huggingface Hub reference:
> metric = datasets.load_metric("cpllab/syntaxgym", download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-9-189ce62668b8> in <module>()
----> 1 metric = datasets.load_metric("cpllab/syntaxgym", download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD)
1 frames
/usr/local/lib/python3.7/dist-packages/datasets/load.py in metric_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, **download_kwargs)
1372 ) from None
1373 else:
-> 1374 raise FileNotFoundError(f"Couldn't find a metric script at {relative_to_absolute_path(combined_path)}.")
1375
1376
FileNotFoundError: Couldn't find a metric script at /content/cpllab/syntaxgym/syntaxgym.py.
A peek at the metric loading logic suggests that only metrics without /
in their name trigger a lookup on the Huggingface hub. This doesn’t seem right to me – how can I make my custom metric available as a community member on the Huggingface hub?