Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradio dependency issue #602

Open
bnaman50 opened this issue Jun 21, 2024 · 2 comments
Open

Gradio dependency issue #602

bnaman50 opened this issue Jun 21, 2024 · 2 comments

Comments

@bnaman50
Copy link

bnaman50 commented Jun 21, 2024

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.

@FahadEbrahim
Copy link

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

@ginic
Copy link

ginic commented Sep 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants