evaluate icon indicating copy to clipboard operation
evaluate copied to clipboard

Gradio dependency issue

Open bnaman50 opened this issue 1 year ago • 2 comments

Context: I noticed this issue when I was working on submitting my own metric to the hub. At the top of the page, it keeps on asking me to update the Gradio version. image

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. However, evaluate library calls it in launch_gradio_widget function in utils dir.

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. 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.

bnaman50 avatar Jun 21 '24 08:06 bnaman50

Hi @bnaman50

Yes, I have the same issue.

I think that another solution would be to modify the code in src/evaluate/utils/gradio.py to change the syntax of the depreciated gr.inputs and gr.outputs to use the interface components directly. For maintaining current available evaluate metrics, the implementation can differ based on the version (an if statement would do).

FahadEbrahim avatar Jul 06 '24 18:07 FahadEbrahim

Yes, I'm seeing this as well with my own metrics on the Hugging Face Hub. The Hugging Face Hub is currently prompting everyone to upgrade to the latest gradio 4.xx.xx version (see screenshot), so this issue will break many metrics spaces. Screenshot 2024-09-13 at 3 31 02 PM

ginic avatar Sep 13 '24 19:09 ginic