| # gradio_client |
| |
| ## 0.5.2 |
| |
| ### Features |
| |
| - [#5653](https://github.com/gradio-app/gradio/pull/5653) [`ea0e00b20`](https://github.com/gradio-app/gradio/commit/ea0e00b207b4b90a10e9d054c4202d4e705a29ba) - Prevent Clients from accessing API endpoints that set `api_name=False`. Thanks [@abidlabs](https://github.com/abidlabs)! |
|
|
| ## 0.5.1 |
|
|
| ### Features |
|
|
| - [#5514](https://github.com/gradio-app/gradio/pull/5514) [`52f783175`](https://github.com/gradio-app/gradio/commit/52f7831751b432411e109bd41add4ab286023a8e) - refactor: Use package.json for version management. Thanks [@DarhkVoyd](https://github.com/DarhkVoyd)! |
|
|
| ## 0.5.0 |
|
|
| ### Highlights |
|
|
| #### Enable streaming audio in python client ([#5248](https://github.com/gradio-app/gradio/pull/5248) [`390624d8`](https://github.com/gradio-app/gradio/commit/390624d8ad2b1308a5bf8384435fd0db98d8e29e)) |
|
|
| The `gradio_client` now supports streaming file outputs 🌊 |
|
|
| No new syntax! Connect to a gradio demo that supports streaming file outputs and call `predict` or `submit` as you normally would. |
|
|
| ```python |
| import gradio_client as grc |
| client = grc.Client("gradio/stream_audio_out") |
| |
| # Get the entire generated audio as a local file |
| client.predict("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict") |
| |
| job = client.submit("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict") |
| |
| # Get the entire generated audio as a local file |
| job.result() |
| |
| # Each individual chunk |
| job.outputs() |
| ``` |
|
|
| Thanks [@freddyaboulton](https://github.com/freddyaboulton)! |
|
|
| ### Fixes |
|
|
| - [#5295](https://github.com/gradio-app/gradio/pull/5295) [`7b8fa8aa`](https://github.com/gradio-app/gradio/commit/7b8fa8aa58f95f5046b9add64b40368bd3f1b700) - Allow caching examples with streamed output. Thanks [@aliabid94](https://github.com/aliabid94)! |
|
|
| ## 0.4.0 |
|
|
| ### Highlights |
|
|
| #### Client.predict will now return the final output for streaming endpoints ([#5057](https://github.com/gradio-app/gradio/pull/5057) [`35856f8b`](https://github.com/gradio-app/gradio/commit/35856f8b54548cae7bd3b8d6a4de69e1748283b2)) |
|
|
| ### This is a breaking change (for gradio_client only)! |
| |
| Previously, `Client.predict` would only return the first output of an endpoint that streamed results. This was causing confusion for developers that wanted to call these streaming demos via the client. |
| |
| We realize that developers using the client don't know the internals of whether a demo streams or not, so we're changing the behavior of predict to match developer expectations. |
| |
| Using `Client.predict` will now return the final output of a streaming endpoint. This will make it even easier to use gradio apps via the client. |
| |
| Thanks [@freddyaboulton](https://github.com/freddyaboulton)! |
| |
| ### Features |
| |
| - [#5076](https://github.com/gradio-app/gradio/pull/5076) [`2745075a`](https://github.com/gradio-app/gradio/commit/2745075a26f80e0e16863d483401ff1b6c5ada7a) - Add deploy_discord to docs. Thanks [@freddyaboulton](https://github.com/freddyaboulton)! |
|
|
| ### Fixes |
|
|
| - [#5061](https://github.com/gradio-app/gradio/pull/5061) [`136adc9c`](https://github.com/gradio-app/gradio/commit/136adc9ccb23e5cb4d02d2e88f23f0b850041f98) - Ensure `gradio_client` is backwards compatible with `gradio==3.24.1`. Thanks [@abidlabs](https://github.com/abidlabs)! |
|
|
| ## 0.3.0 |
|
|
| ### Highlights |
|
|
| #### Create Discord Bots from Gradio Apps 🤖 ([#4960](https://github.com/gradio-app/gradio/pull/4960) [`46e4ef67`](https://github.com/gradio-app/gradio/commit/46e4ef67d287dd68a91473b73172b29cbad064bc)) |
|
|
| We're excited to announce that Gradio can now automatically create a discord bot from any `gr.ChatInterface` app. |
|
|
| It's as easy as importing `gradio_client`, connecting to the app, and calling `deploy_discord`! |
|
|
| _🦙 Turning Llama 2 70b into a discord bot 🦙_ |
|
|
| ```python |
| import gradio_client as grc |
| grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot") |
| ``` |
|
|
| <img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/guide/llama_chat.gif"> |
|
|
| #### Getting started with template spaces |
|
|
| To help get you started, we have created an organization on Hugging Face called [gradio-discord-bots](https://huggingface.co/gradio-discord-bots) with template spaces you can use to turn state of the art LLMs powered by Gradio to discord bots. |
|
|
| Currently we have template spaces for: |
|
|
| - [Llama-2-70b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/Llama-2-70b-chat-hf) powered by a FREE Hugging Face Inference Endpoint! |
| - [Llama-2-13b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/Llama-2-13b-chat-hf) powered by Hugging Face Inference Endpoints. |
| - [Llama-2-13b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/llama-2-13b-chat-transformers) powered by Hugging Face transformers. |
| - [falcon-7b-instruct](https://huggingface.co/spaces/gradio-discord-bots/falcon-7b-instruct) powered by Hugging Face Inference Endpoints. |
| - [gpt-3.5-turbo](https://huggingface.co/spaces/gradio-discord-bots/gpt-35-turbo), powered by openai. Requires an OpenAI key. |
|
|
| But once again, you can deploy ANY `gr.ChatInterface` app exposed on the internet! So don't hesitate to try it on your own Chatbots. |
|
|
| ❗️ Additional Note ❗️: Technically, any gradio app that exposes an api route that takes in a single string and outputs a single string can be deployed to discord. But `gr.ChatInterface` apps naturally lend themselves to discord's chat functionality so we suggest you start with those. |
|
|
| Thanks [@freddyaboulton](https://github.com/freddyaboulton)! |
|
|
| ### New Features: |
|
|
| - Endpoints that return layout components are now properly handled in the `submit` and `view_api` methods. Output layout components are not returned by the API but all other components are (excluding `gr.State`). By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4871](https://github.com/gradio-app/gradio/pull/4871) |
|
|
| ### Bug Fixes: |
|
|
| No changes to highlight |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| # 0.2.9 |
|
|
| ### New Features: |
|
|
| No changes to highlight |
|
|
| ### Bug Fixes: |
|
|
| - Fix bug determining the api name when a demo has `api_name=False` by [@freddyboulton](https://github.com/freddyaboulton) in [PR 4886](https://github.com/gradio-app/gradio/pull/4886) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| - Pinned dependencies to major versions to reduce the likelihood of a broken `gradio_client` due to changes in downstream dependencies by [@abidlabs](https://github.com/abidlabs) in [PR 4885](https://github.com/gradio-app/gradio/pull/4885) |
|
|
| # 0.2.8 |
|
|
| ### New Features: |
|
|
| - Support loading gradio apps where `api_name=False` by [@abidlabs](https://github.com/abidlabs) in [PR 4683](https://github.com/gradio-app/gradio/pull/4683) |
|
|
| ### Bug Fixes: |
|
|
| - Fix bug where space duplication would error if the demo has cpu-basic hardware by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4583](https://github.com/gradio-app/gradio/pull/4583) |
| - Fixes and optimizations to URL/download functions by [@akx](https://github.com/akx) in [PR 4695](https://github.com/gradio-app/gradio/pull/4695) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| # 0.2.7 |
|
|
| ### New Features: |
|
|
| - The output directory for files downloaded via the Client can now be set by the `output_dir` parameter in `Client` by [@abidlabs](https://github.com/abidlabs) in [PR 4501](https://github.com/gradio-app/gradio/pull/4501) |
|
|
| ### Bug Fixes: |
|
|
| - The output directory for files downloaded via the Client are now set to a temporary directory by default (instead of the working directory in some cases) by [@abidlabs](https://github.com/abidlabs) in [PR 4501](https://github.com/gradio-app/gradio/pull/4501) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| # 0.2.6 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| - Fixed bug file deserialization didn't preserve all file extensions by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4440](https://github.com/gradio-app/gradio/pull/4440) |
| - Fixed bug where mounted apps could not be called via the client by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4435](https://github.com/gradio-app/gradio/pull/4435) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| # 0.2.5 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| - Fixes parameter names not showing underscores by [@abidlabs](https://github.com/abidlabs) in [PR 4230](https://github.com/gradio-app/gradio/pull/4230) |
| - Fixes issue in which state was not handled correctly if `serialize=False` by [@abidlabs](https://github.com/abidlabs) in [PR 4230](https://github.com/gradio-app/gradio/pull/4230) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| # 0.2.4 |
|
|
| ### Bug Fixes: |
|
|
| - Fixes missing serialization classes for several components: `Barplot`, `Lineplot`, `Scatterplot`, `AnnotatedImage`, `Interpretation` by [@abidlabs](https://github.com/abidlabs) in [PR 4167](https://github.com/gradio-app/gradio/pull/4167) |
|
|
| ### Documentation Changes: |
|
|
| No changes to highlight. |
|
|
| ### Testing and Infrastructure Changes: |
|
|
| No changes to highlight. |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| ### Contributors Shoutout: |
|
|
| No changes to highlight. |
|
|
| # 0.2.3 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| - Fix example inputs for `gr.File(file_count='multiple')` output components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4153](https://github.com/gradio-app/gradio/pull/4153) |
|
|
| ### Documentation Changes: |
|
|
| No changes to highlight. |
|
|
| ### Testing and Infrastructure Changes: |
|
|
| No changes to highlight. |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| ### Contributors Shoutout: |
|
|
| No changes to highlight. |
|
|
| # 0.2.2 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| - Only send request to `/info` route if demo version is above `3.28.3` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4109](https://github.com/gradio-app/gradio/pull/4109) |
|
|
| ### Other Changes: |
|
|
| - Fix bug in test from gradio 3.29.0 refactor by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4138](https://github.com/gradio-app/gradio/pull/4138) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| # 0.2.1 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| Removes extraneous `State` component info from the `Client.view_api()` method by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107) |
|
|
| ### Documentation Changes: |
|
|
| No changes to highlight. |
|
|
| ### Testing and Infrastructure Changes: |
|
|
| Separates flaky tests from non-flaky tests by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107) |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| ### Contributors Shoutout: |
|
|
| No changes to highlight. |
|
|
| # 0.1.4 |
|
|
| ### New Features: |
|
|
| - Progress Updates from `gr.Progress()` can be accessed via `job.status().progress_data` by @freddyaboulton](https://github.com/freddyaboulton) in [PR 3924](https://github.com/gradio-app/gradio/pull/3924) |
|
|
| ### Bug Fixes: |
|
|
| - Fixed bug where unnamed routes where displayed with `api_name` instead of `fn_index` in `view_api` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3972](https://github.com/gradio-app/gradio/pull/3972) |
|
|
| ### Documentation Changes: |
|
|
| No changes to highlight. |
|
|
| ### Testing and Infrastructure Changes: |
|
|
| No changes to highlight. |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| ### Contributors Shoutout: |
|
|
| No changes to highlight. |
|
|
| # 0.1.3 |
|
|
| ### New Features: |
|
|
| No changes to highlight. |
|
|
| ### Bug Fixes: |
|
|
| - Fixed bug where `Video` components in latest gradio were not able to be deserialized by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3860](https://github.com/gradio-app/gradio/pull/3860) |
|
|
| ### Documentation Changes: |
|
|
| No changes to highlight. |
|
|
| ### Testing and Infrastructure Changes: |
|
|
| No changes to highlight. |
|
|
| ### Breaking Changes: |
|
|
| No changes to highlight. |
|
|
| ### Full Changelog: |
|
|
| No changes to highlight. |
|
|
| ### Contributors Shoutout: |
|
|
| No changes to highlight. |
|
|
| # 0.1.2 |
|
|
| First public release of the Gradio Client library! The `gradio_client` Python library that makes it very easy to use any Gradio app as an API. |
|
|
| As an example, consider this [Hugging Face Space that transcribes audio files](https://huggingface.co/spaces/abidlabs/whisper) that are recorded from the microphone. |
|
|
|  |
|
|
| Using the `gradio_client` library, we can easily use the Gradio as an API to transcribe audio files programmatically. |
|
|
| Here's the entire code to do it: |
|
|
| ```python |
| from gradio_client import Client |
| |
| client = Client("abidlabs/whisper") |
| client.predict("audio_sample.wav") |
| |
| >> "This is a test of the whisper speech recognition model." |
| ``` |
|
|
| Read more about how to use the `gradio_client` library here: https://gradio.app/getting-started-with-the-python-client/ |