Gradio Profile picture
Jul 17 β€’ 7 tweets β€’ 3 min read Twitter logo Read on Twitter
BIG NEWS πŸ₯³πŸŽˆ

Building Chatbots apps just got wayyy easier: announcing the new π™²πš‘πšŠπšπ™Έπš—πšπšŽπš›πšπšŠπšŒπšŽ class πŸ™Œ

The *fastest* way to build to build a Chatbot UI in Python -- including streaming, undo/retry, API, all out of the box!

Let's take a look at a few examples... Image
The π™²πš‘πšŠπšπ™Έπš—πšπšŽπš›πšπšŠπšŒπšŽ only has 1 required parameter: a function that takes in:

- an input message (string)
- a history (list of list of strings)

and returns:
- a response (string)

Here's a toy example: (for the example above!) Image
The π™²πš‘πšŠπšπ™Έπš—πšπšŽπš›πšπšŠπšŒπšŽ class works beautifully with @langchain classes

Here's a complete example querying GPT3.5 in 19 lines of code Image
To add streaming, just use a generator (πš’πš’πšŽπš•πš) instead of a regular function (πš›πšŽπšπšžπš›πš—) Image
Of course, you can customize it a lot more by adding examples, title/description, buttons (but you can get a fully-functioning chatbot without any of these!) Image
You also get a dedicated, easy-to-use API endpoint:

/πšŒπš‘πšŠπš Image
Out in the latest version of gradio:

πš™πš’πš™ πš’πš—πšœπšπšŠπš•πš• --πšžπš™πšπš›πšŠπšπšŽ πšπš›πšŠπšπš’πš˜

Read more here: gradio.app/guides/creatin…

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Gradio

Gradio Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Gradio

Apr 13
πŸ’« We're excited to launch a NEW Python library πŸ’«

The πšπš›πšŠπšπš’πš˜_πšŒπš•πš’πšŽπš—πš library lets you run any Gradio app as an API πŸš€

See a cool Hugging Face Space? Use it programmatically instantly: Image
You can connect to private Spaces by passing in your Hugging Face token Image
Works with any kind of Gradio demo: an Interface or a Blocks, any number of inputs or outputs: Image
Read 6 tweets
Oct 27, 2022
Gradio 3.7 is out! Everything that is new in 3.7 πŸ”½

1. Gradio now supports *batched* function. You can specify a batch size and Gradio will automatically batch incoming requests so that your demo runs on a lot faster on Spaces! Image
2. A new upload() event for Video, Audio, Image, and File components: Image
3. An assortment of bugfixes Image
Read 6 tweets
Sep 8, 2022
Excited to release 3 big features as part of πšπš›πšŠπšπš’πš˜ 𝟹.𝟹 🧑

1. Iterative outputs: you can now `yield` a sequence of outputs and they will show up sequentially in your Gradio demo:
2. The πšπš›πšŠπšπš’πš˜.π™°πšŒπšŒπš˜πš›πšπš’πš˜πš— class, which allows you to toggle on/off the visibility of components (think advanced options) in your demo very easily:
3. Loading Tabular Models from the @huggingface Hub:

Our integration with skops allows you to load tabular classification/regression models from the hub:

πšπš›.π™Έπš—πšπšŽπš›πšπšŠπšŒπšŽ.πš•πš˜πšŠπš("πš–πš˜πšπšŽπš•πšœ/πšœπšŒπš’πš”πš’πš-πš•πšŽπšŠπš›πš—/πšπšŠπš‹πšžπš•πšŠπš›-πš™πš•πšŠπš’πšπš›πš˜πšžπš—πš").πš•πšŠπšžπš—πšŒπš‘() Image
Read 4 tweets
Jun 2, 2022
Now it's time for our favorite part of the Blocks Party: awarding the top machine learning demos πŸ†

We had more than 50 incredibly creative and complex demos, built entirely in PythonπŸ’«

Here are the top 5, as voted by your likes... 🧑
In 5th place, with 22 likes, is: StyleGAN-NADA πŸ₯³

Built by @RinonGalt, he demo allows you to edit specific attributes in your face, and generate a new picture with specific styles turned on or off. It's scary good!

Link: huggingface.co/spaces/Gradio-…
In 4th place, with 24 likes, is: GPT-J Poetry Illustrator πŸ₯³

Built by @yvrjsharma, the demo writes a poem & illustrates it, from a SINGLE word that you give it. A really great example of mixing different machine learning models together like legos!

Link: huggingface.co/spaces/Gradio-…
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(