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

Customize Gradio Interface that is Launched #298

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Sep 22, 2022

I'd like to be able to customize the Gradio Interface that is created by evaluate.utils.launch_gradio_widget(). There are several reasons why this might be useful:

  1. For example, if someone is launching a Gradio Interface for a metric locally, they might want to customize the look and feel of the Gradio app, e.g. by removing the article with the long description

  2. For the metric spaces, in some cases the default UI is not rendered correctly. For example, in this Space: https://huggingface.co/spaces/evaluate-metric/mean_iou, it would be better if the title read "Metric: mean IoU" instead of "Metric: mean_io_u". Currently, there is no way to make this change.

This PR introduces the ability to provide arguments for gr.Interface() that override the default ones. Usage:

from evaluate.utils import launch_gradio_widget

launch_gradio_widget(module, title="Metric: mean IoU")

This is just a proposal, happy to hear feedback or alternative suggestions.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@lvwerra
Copy link
Member

lvwerra commented Sep 27, 2022

Thanks @abidlabs! This looks great, since this will update all evaluation spaces would you mind setting up a test space which installs this branch to test that this works? You could for example copy evaluate-metrics/accuracy to your namespace on the Hub.

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

Successfully merging this pull request may close these issues.

3 participants