huggingface / huggingface/evaluate

Suppress the output of nltk download logs when loading metric via evaluate

Open
#671 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.5k
Forks
341
PR merge metrics
No merged PRs in 30d

Description

How can the output of nltk be suppressed when loading `sacrebleu` via the `evaluate` library?

The minimal code is as follows:
```
import evaluate
bleu = evaluate.load("sacrebleu")
```
Then the output in the Jupyter Notebook is as follows:
```
Using the latest cached version of the module from /home/jupyter-raptor/.cache/huggingface/modules/evaluate_modules/metrics/evaluate-metric--sacrebleu/28676bf65b4f88b276df566e48e603732d0b4afd237603ebdf92acaacf5be99b (last modified on Fri Nov 8 20:44:01 2024) since it couldn't be found locally at evaluate-metric--sacrebleu, or remotely on the Hugging Face Hub.
[nltk_data] Downloading package wordnet to /home/jupyter-
[nltk_data] raptor/nltk_data...
[nltk_data] Package wordnet is already up-to-date!
[nltk_data] Downloading package punkt to /home/jupyter-
[nltk_data] raptor/nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package omw-1.4 to /home/jupyter-
[nltk_data] raptor/nltk_data...
[nltk_data] Package omw-1.4 is already up-to-date!
```
This issue also happens for `chrf`, `meteor` and `bertscore` (and probably others).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.