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

add params to gr.Interface and gr.ChatInterface #7124

Merged
merged 14 commits into from Jan 24, 2024
Merged

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Jan 23, 2024

Adds some missing parameters to gr.Interface and gr.ChatInterface to make them more consistent with each other:

Test code:

import gradio as gr

io = gr.Interface(lambda x:x, 
             "textbox", 
             "textbox", 
             submit_btn="🚀", 
             clear_btn=gr.Button("🗑️", variant="stop"), 
             flagging_options=[("🚩", "🚩")]
            )
io.launch()

and

import gradio as gr

io = gr.ChatInterface(lambda x,y:x, js="alert('hi')")
io.launch()

Needed to do some internal refactoring to satisfy the typechecker.

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 23, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/08553d92d6fe47ce15ef311c0dc7b1ddb8d8123a/gradio-4.15.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@08553d92d6fe47ce15ef311c0dc7b1ddb8d8123a#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 23, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

add params to gr.Interface and gr.ChatInterface

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs abidlabs marked this pull request as ready for review January 23, 2024 20:19
Copy link
Collaborator

@dawoodkhan82 dawoodkhan82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and both work great.

@abidlabs
Copy link
Member Author

Thanks @dawoodkhan82!

@abidlabs abidlabs merged commit 21a16c6 into main Jan 24, 2024
14 checks passed
@abidlabs abidlabs deleted the interface-params branch January 24, 2024 17:29
@pngwn pngwn mentioned this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants