huggingface / huggingface/evaluate
Gradio dependency issue
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 341
- PR merge metrics
- No merged PRs in 30d
Description
**Context:**
I noticed this issue when I was working on submitting my own [metric](https://huggingface.co/spaces/nbansal/semf1) to the hub. At the top of the page, it keeps on asking me to update the Gradio version.
**Error:**
Upon updating it, I got the following error - `AttributeError: module 'gradio' has no attribute 'inputs'`.
**Reason:**
Upon further digging, I think the issue is occurs whenever you upgrade Gradio to version `>=4.0`. Turns out from version 4 onwards, `gradio.inputs` has been removed as you can see in the `__init__` [file](https://github.com/gradio-app/gradio/blob/gradio%404.0.0/gradio/__init__.py). However, `evaluate` library calls it in `launch_gradio_widget` function in `utils` [dir](https://github.com/huggingface/evaluate/blob/main/src/evaluate/utils/gradio.py#L114).
**Solution:**
A simple solution would be to limit the dependency below Gradio version 4.0.0. This can be done by simply updating the line 63 in `setup.py` [file]((https://github.com/huggingface/evaluate/blob/main/setup.py#L63)). More specifically, instead of - `"gradio>=3.0.0"`, it can be chnaged to `"gradio>=3.0.0, <4.0.0"` to fix the issue.
P.S. - I am still working on the metric so the page might go down until I fully complete it.
Contributor guide
Assessment
This issue has not been assessed yet.