gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.37k stars 2.26k forks source link

Adds `examples_per_page` to `gr.ChatInterface` and allows `clear_btn` in `gr.Interface` to be hidden #8244

Closed abidlabs closed 1 month ago

abidlabs commented 1 month ago

A few small changes in this PR:

  1. First, adds examples_per_page to gr.ChatInterface, closes: https://github.com/gradio-app/gradio/issues/8233. My original plan had been to add support for providing an instance of gr.Examples but this does not really make sense since a user can't provide the correct fn to examples since the example function is redefined internally. We also have the same examples_per_page argument in gr.Interface
  2. I went through the arguments of gr.Interface to make sure that we have equivalent arguments in gr.ChatInterface and made a few other small tweaks, such as allowing clear_btn in gr.Interface to be set to None hiding it, similar to how the buttons in gr.ChatInterface. I believe there was an issue about this that we closed
  3. Adds some docs to gr.ChatInterface guide
gradio-pr-bot commented 1 month ago

🪼 branch checks and previews

• Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
:unicorn: Changes detecting...

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/de1ee9ade13a340113cf73285f636a7e3a91236f/gradio-4.29.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@de1ee9ade13a340113cf73285f636a7e3a91236f#subdirectory=client/python"
gradio-pr-bot commented 1 month ago

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor

With the following changelog entry.

Adds examples_per_page to gr.ChatInterface and allows clear_btn in gr.Interface to be hidden

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](https://github.com/gradio-app/gradio/edit/examples-chat-interface/.changeset/fruity-books-win.md).
yvrjsharma commented 1 month ago

This is awesome; thanks for taking care of this feature request, @abidlabs ! 🙌 The examples_per_page argument is now working for me for the ChatInterface component as well 🥳

abidlabs commented 1 month ago

Thanks @yvrjsharma for confirming!