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

chore: update versions #5038

Merged
merged 6 commits into from
Aug 10, 2023
Merged

chore: update versions #5038

merged 6 commits into from
Aug 10, 2023

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Jul 28, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@gradio/[email protected]

Features

Fixes

[email protected]

Highlights

Client.predict will now return the final output for streaming endpoints (#5057 35856f8b)

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!

Features

Fixes

[email protected]

Highlights

Client.predict will now return the final output for streaming endpoints (#5057 35856f8b)

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!

Features

Fixes

highlight:

Now supports loading streamed outputs

Allows users to use generators to stream audio out, yielding consecutive chunks of audio. Requires streaming=True to be set on the output audio.

import gradio as gr
from pydub import AudioSegment

def stream_audio(audio_file):
    audio = AudioSegment.from_mp3(audio_file)
    i = 0
    chunk_size = 3000
    
    while chunk_size*i < len(audio):
        chunk = audio[chunk_size*i:chunk_size*(i+1)]
        i += 1
        if chunk:
            file = f"/tmp/{i}.mp3"
            chunk.export(file, format="mp3")            
            yield file
        
demo = gr.Interface(
    fn=stream_audio,
    inputs=gr.Audio(type="filepath", label="Audio file to stream"),
    outputs=gr.Audio(autoplay=True, streaming=True),
)

demo.queue().launch()

From the backend, streamed outputs are served from the /stream/ endpoint instead of the /file/ endpoint. Currently just used to serve audio streaming output. The output JSON will have is_stream: true, instead of is_file: true in the file data object. Thanks @aliabid94!

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

@gradio/[email protected]

Patch Changes

[email protected]

Features

Fixes

@gradio/[email protected]

Highlights

Client.predict will now return the final output for streaming endpoints (#5057 35856f8b)

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!

Features

@gradio/[email protected]

Features

@gradio/[email protected]

Features

@gradio/[email protected]

Features

@gradio/[email protected]

Fixes

@gradio/[email protected]

Fixes

  • #5062 7d897165 - gr.Dropdown now has correct behavior in static mode as well as when an option is selected. Thanks @abidlabs!
  • #5039 620e4645 - gr.Dropdown() now supports values with arbitrary characters and doesn't clear value when re-focused. Thanks @abidlabs!

@gradio/[email protected]

Features

@gradio/[email protected]

Features

@gradio/[email protected]

Features

@gradio/[email protected]

Features

Fixes

@gradio/[email protected]

Fixes

highlight:

Now supports loading streamed outputs

Allows users to use generators to stream audio out, yielding consecutive chunks of audio. Requires streaming=True to be set on the output audio.

import gradio as gr
from pydub import AudioSegment

def stream_audio(audio_file):
    audio = AudioSegment.from_mp3(audio_file)
    i = 0
    chunk_size = 3000
    
    while chunk_size*i < len(audio):
        chunk = audio[chunk_size*i:chunk_size*(i+1)]
        i += 1
        if chunk:
            file = f"/tmp/{i}.mp3"
            chunk.export(file, format="mp3")            
            yield file
        
demo = gr.Interface(
    fn=stream_audio,
    inputs=gr.Audio(type="filepath", label="Audio file to stream"),
    outputs=gr.Audio(autoplay=True, streaming=True),
)

demo.queue().launch()

From the backend, streamed outputs are served from the /stream/ endpoint instead of the /file/ endpoint. Currently just used to serve audio streaming output. The output JSON will have is_stream: true, instead of is_file: true in the file data object. Thanks @aliabid94!

@gradio/[email protected]

Fixes

@vercel
Copy link

vercel bot commented Jul 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Aug 10, 2023 8:44pm

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 28, 2023

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-5038-all-demos


You can install the changes in this PR by running:

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

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 28, 2023

🎉 Chromatic build completed!

There are 0 visual changes to review.
There are 0 failed tests to fix.

@abidlabs abidlabs merged commit 9d1bd28 into main Aug 10, 2023
@abidlabs abidlabs deleted the changeset-release/main branch August 10, 2023 20:59
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