Skip to content

v2.7.5

Compare
Choose a tag to compare
@aliabd aliabd released this 21 Jan 18:57
· 1737 commits to master since this release

Here's what's new in 2.7.5:

1. Backend Migration to Starlette and FastAPI 🛠️

We have migrated gradio's backend from flask to starlette and fastapi. We did this to take advantage of speed and running things asynchronously. Migration work was done in #440

This should not affect user workflow at all—just make it faster!

Load testing before and after migration:

Screen Shot 2022-01-21 at 6 40 07 PM

2. (BETA) Custom Flagging Callbacks and HuggingFaceDatasetSaver 🏁

We’ve expanded functionality on our Flagging feature. You can now write custom code that gets run when the FLAG button is clicked. One cool thing that this allows you to do is to easily build a crowd-sourced :hugging_face: Hugging Face dataset from people trying out your model and flagging samples of interest. This was primarily built in #362

For example, here's the code to build a demo for a simple text-to-text interface that saves all the inputs and outputs to a Hugging Face dataset:

import gradio as gr

HF_TOKEN = <YOUR_HF_TOKEN>
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "hello-world", private=False) 
iface = gr.Interface(lambda x:"hello " + x + "!", "text", "text", flagging_callback=hf_writer)

iface.launch(share=True)

Running the code above will produce:

flagging-with-datasets.mov

Note: You may start using this immediately but the team is still working on making it better. Feel free to reach out to us with feedback here or on a discussions post.

3. Small Fixes 🔧

  • Concurrency issue fixed: #472
  • Queueing bug fixed: #474

What's Changed

New Contributors

Full Changelog: v2.7.1...v2.7.5