Quick, beautiful web UIs for ML apps
5 Apr 2022 · 41 min
Abubakar Abid, Gradio's team lead at Hugging Face, explains how the open-source Python library wraps ML models with web interfaces in minutes. Gradio started in medical imaging, now integrates with Hugging Face Hub, and includes a flagging button that saves failing examples to CSV for retraining.
Chapters
But I think one of the very interesting developments that we're seeing and we're trying to understand this piece better, is that people used to just have demos as kind of standalone things, but now people are taking demos and integrating it onto their websites. One of our users, for example, built this NFT search engine. The back end of it is a Gradio app. He hosted it on Spaces and just like embedded that spaces on the homepage of his website. And so his whole website, I mean, it has some surrounding information, but it's basically a Gradio demo. We've seen this in a few different examples and this kind of raises the question. So now it seems like a lot of people are building very data centric or machine learning centric applications. That's like the focus of it.
Hello, friends. Jared here to tell you about changelog, our membership program for those of you who want to directly support our work. Your plus plus membership gets you closer to the metal with extended episodes, makes the app pads disappear, and takes our audio to the next level with higher bitrate MP3s. You can join today at changelog.com. Welcome to Practical AI, a weekly podcast making artificial intelligence practical, productive and accessible to everyone. This is where conversations around AI, machine learning and data science happen. Join us at PracticalAI FM community and follow the show on Twitter. We're at PracticalAI FM. Thank you to our partners at Fastly for shipping our pods super fast all around the world. Check them out@fastly.com.
Welcome to another episode of Practical AI. This is Daniel Whitenack. I am a data scientist with SIL International. I'm joined, as always by my co host, Chris Benson, who is a tech strategist at Lockheed Martin. How you doing, Chris?
Doing very well, except I'm drowning in yellow pine pollen.
Yeah, it's allergy season.
Yeah, it's everywhere other than that. Doing great.
Yeah. Yeah, Allergy season. I've been rotating between sneezing and then debugging. Some, like, Nvidia issue today. So it's like Nvidia issue, sneeze, come back, see if it's fixed. Sneeze, blow my nose.
Is the Nvidia issue contributing to the sneezing?
I don't.
I don't know. I don't know.
Is there a correlation between the two?
Let's say no on the record.
It's just inspired. Like the next line of Nvidia processors. That would be like the sneeze or something, you know?
Yeah, yeah.
They need good marketing. And you're providing that for a free service.
Yeah, I guess. I guess so. Yeah. Speaking of practical things, I'm pretty excited about our guest today because, as you know, I'm always wanting to get into the practicalities of what we're talking about, and this really fits into that. I'm sure a lot of our listeners have heard about Gradio. And today we have with us Abubakar Abid, who is the Gradio team lead at Hugging Face. Welcome.
Thank you so much, guys. It's awesome to be here.
Yeah, yeah. As we get started, maybe just give us a little bit of a sense of your background and how you eventually found your way into thinking about radio, like things or interfaces or apps for machine learning.
Yeah, absolutely. So I've been doing machine learning for about a decade now. I did my PhD at Stanford and I worked a lot on building machine learning models for medical imaging and medical videos, that kind of thing. And during the course of my PhD, I would often work with collaborators who are not machine learning scientists, not machine learning engineers. There were doctors, clinicians, biologists, that kind of thing. And one of the things that we realized was, well, first of all, not everyone knows how to use machine learning models directly. Not everyone can code software engineering and all that good stuff. And we wanted to make it easy for other people to try out the model so that they could get feedback because sometimes you, it tells someone, hey, I created a model for you. It's like 95% accurate. They're not going to believe you. They're not going to take your word necessarily. They want to try it out themselves and test it. And so we started off with a very simple library that was designed to make it easy to test computer vision models. That ultimately grew into Gradio, which is an open source Python library. To build machine learning models, very generally, to build GUIs for machine learning models, very generally, to build demos, web apps for machine learning models. And then I actually finished my PhD at Stanford last year. And then soon after that, actually Gradio got acquired by Hugging Face. And so now we're here at Hugging Face, which is a fantastic place to be. And really we have this amazing mandate, which is, hey, let's make radio the default tool for machine learning practitioners to build demos to get their work out there so that other people can access their work, so that machine learning researchers can make their work more reproducible. Machine learning teams can easily collaborate and kind of see what machine learning models are actually doing. And we're hoping to grow this a lot more in the next few years.
So just to blow it out. So for those in our audience who are not familiar with Gradio, could you talk specifically about what that is since we've all been talking about it for a few minutes and I want to make sure that they have a clear image of what you're talking about?
Yeah, absolutely. So Gradio is an open source Python library. So you can pip install it and what it does is it takes a machine learning model that you've built, or it could also be an API or any sort of function, but it takes something that you've built and wraps it with a gui. So you have this like web based gui. So imagine like you have an image classification model. You can easily wrap a web based GUI that allows you to drag and drop your images, see the model's predictions. But the cool thing is that you can build this GUI entirely from Python. So in the past if you wanted to build a web application around your model, you needed to know Flask, but then also maybe Docker to containerize it and then maybe some bash scripts and then you need to figure out web hosting solutions and then you need to maybe know a little bit of SQL to build a database to collect samples and then maybe some front end web development, HTML, CSS, JavaScript to kind of build a little UI around it. All of that in one framework in Python, which is already something that you know if you're doing machine learning.
Yeah. So before the show I was just running a few things in Gradio and I have in the past, but I kind of revisited a few things that I was playing around with. Right now I've got an application running to do just like question answering, which is actually something that we do at SIL and work very closely with those sorts of models. Just to give people a sense, I created this application and I'm looking at it right now. It's 10 lines of code, three of those are blank lines and in those 10 lines of code imported question answering model. And like you say wrapped it in this function, this question answer function. And then with that when I do Python, you know, this app Py, then it spins up a web server and I can go into my browser and interact with the model. So yeah, it's pretty cool. I think it's like pretty interesting that it's almost like it seems like you can have superpowers, like you get sort of superpowers to do this web stuff without having to actually know that stuff. I'm curious from your perspective now, doing this for quite a while, seeing a lot of people use Gradio, in the context of like industry and companies, where do you think like the value add comes from? This type of, I don't know if you'd consider it like a prototype or an app or a tool. Where does the value add come within the workflow of a typical data scientist or something like that?
Yeah, no, I think this is a really important question. So the way that I've seen machine learning done, both in research kind of settings, but also in industry teams, is that there's almost like two cycles of machine learning. There's the prototyping exploration research cycle, and then there's kind of the deployment cycle and the kind of the workflows. And the tools that are used in both of the cycles are very different. So in the first one, in the research exploration, you're mostly working in jupyter notebooks doing a lot of trial and error. You're building lots and lots of models oftentimes and you're getting feedback. And this is really important, you're getting feedback from stakeholders because it's impractical and usually not the case that the machine learning developer knows everything about what kind of data, how the model is going to be used. It's oftentimes end users, sometimes quality testers, sometimes customers, sometimes business teams who are going to be the ultimate consumers of these models. So there's the producers of the models, there's the consumer of the models, and traditionally it's very hard for those two types of folks to talk to each other. And so what Gradio does, it kind of creates the bridge between these two teams. So let's say you're a machine learning researcher, scientist, developer, whatever your role is, you can easily take a model that you've built and then expose it so that it can be consumed by a variety of different people. And we've seen that be sometimes quality testing teams. So one of the things you'll notice in a Gradio demo, by default there's this flag button as well, which helps you catch incorrect predictions and so on and store them in a local database on your computer and stuff like that. So that's very useful. And it's really designed for quality testing teams or even end users to try out your model and get back to you. The whole idea behind Gradio is it's so intuitive. Very few people know how to build machine learning models. Kind of in the grand scheme of things, more people know how to maybe load a model if you've given a model and maybe run some code against it. But way more people know how to use a browser. Billions of people can literally drag and drop images into a browser and try it out. And what that does is it lets you, it reminds you that your audience when you're building these machine learning models is very broad and it puts the control in their hands so they can try it out and give you feedback.
Is it kind of conceptualizing it? A little bit. If you're making an analogy to web development, a little bit. And you have these frameworks out there to make it easier, like react and angular and stuff like that, is it a little bit like that or is it more focused on just the model? When you talk about creating that user experience so that you can share it with people, what does a typical experience look like?
Yeah, it's a really good question. So even when we started Gradio and recently we've been having this conversation about how general purpose do we want Gradio to be? Like, do we want it to be the way you create any sort of web application directly from Python? That would be really cool and I think we're working towards that goal. But we've intentionally started with these higher level abstractions that are designed for machine learning models. Really if you have a machine learning model and you want to wrap it with a demo, with a gui, you can do it in less than three lines of code, as Daniel was just talking about. That's because we've created these high level abstractions that make it super easy to plug in a model, plug in what kind of input you want, plug in what kind of output creates that GUI for you. So really the developer experience right now as is designed really for machine learning kind of engineers and researchers, and this is one of the things we're working on right now, is we're exposing a low level API that can allow you to actually build more complicated and potentially a much wider array of web applications, whether they be for other use cases in machine learning, like for example, labeling or annotation or data set exploration, or it could be for other things altogether.
And partly because of great communities like Hugging Face and other communities, you know, we are seeing this rapid proliferation of all sorts of kinds of models and how they're used to do like all sorts of interesting things. So could you describe a little bit with Gradio, like maybe those main use cases where it's super easy, Like I did the question answering thing and then maybe other cases. How does like the customization work? Maybe someone out there is thinking like, oh, well, I'm not quite doing the same type of like Object recognition or text summarization or something like that. How does that work?
Yeah, absolutely. So Gradio started off actually designed for images. That was kind of the image related tasks. But at this point it covers pretty much, I would say 95% of machine learning use cases. And the way it does that, and this kind of goes back to your previous question, Chris, about who is designed for and the way it does that. It comes shipped with pre built components. So the idea is, hey, I'm working with videos, I want a video input and maybe my output is, I don't know, it's a heat map, it's an image or it's a plot or whatever it may be. So Radio comes in shipped with all of these different components, making it super easy for basically your use case. Could be anything from I don't know, maybe I'm doing video activity detection to anything to more traditional data science. Maybe I'm working with data frames and other kinds of graphs and time series data. Radio has components for all of that. We're always adding new things. And so for example, we just added automatic speech or real time speech recognition so you can speak and as you're speaking you can get a transcription rendered real time. We have a lot more things in the pipeline as well, things like 3D images and 3D models and objects. That's going to be released pretty soon as well.
So I'm just looking at the documentation and I was also playing around with a couple other things before this conversation. And it covers a lot of components. So like input components including things like, you know, sliders and text box and video and audio output components, data frames, files, labels, text box. So like I also work in dialogue systems with sil and there's even like a chatbot output. Yeah, I actually didn't know that before I went into your, like went into your docs again after I'd used it in a while and I was like, that's cool. So I clicked on that and just like opened a notebook and had like a chatbot interface to like plug into my NLU model, which was, which was really cool.
You can stitch all of these together as well. So what we, you know, one of the things that kind of astounds me is sometimes people will build super complex. Like a model will take like eight different inputs and they will write all of the gradio code that's needed to create this input that takes eight different things. And the GUI is so complicated. And I'm like, wow, they write all this code which isn't too Much code, but still you have to read the documentation, understand the parameters and all of that. And people do all of that. Because the alternative is kind of terrible. The alternative is having to write all of this front end stuff.
No one wants to do that.
No one wants to do that. So having this ability, kind of the superpower to do it in Python, I think it's is quite nice.
So you already mentioned the acquisition by hugging face and now you're, you know, lead of the Gradio team at Hugging face, which is, which is super exciting. So our listeners can't see video, but I made sure and I wore my new hugging face hat today for the interview. I don't know if you see that. Obviously I have a little bit of bias on my side for hugging face, as our listeners will know.
I'm jealous because I don't have a hugging face hat.
How did you get one? I don't have one either. Well, I don't know.
I saw someone on Twitter post like, hey, beta of the hugging face store. And I don't know if it's like public yet, maybe I'm not supposed to be sharing this, but I saw it on Twitter, like beta of the hugging face store. And I was like, oh, yeah. So I clicked there and then I ordered swag for my whole team. So I splurged a little bit. They won't be surprised, I guess if they listen to this podcast they'll try to get it to them before then. But yeah, anyway, with hugging face, like, so you've described Gradio, we've talked about hugging face on the show many times. But maybe you could just give us from your perspective, like, what is hugging face and why does it make sense to have like Gradio plus hugging face?
Yeah, absolutely. Hugging face does a lot of things, so it's hard to describe concisely, but basically, I think the overarching goal of hugging face is to make machine learning more accessible. Right. So previously, if you wanted to use state of the art machine learning models, you have to wrangle with a lot of, you know, you have to read papers, you have to wrangle with a lot of, I think, malformed GitHub repos.
I don't miss those days at all.
Exactly. It's a lot of work. I remember that from my PhD as well. It's a lot of work. The way I see it is that hugging face offers various levels of access. Right. So for example, there's hugging face datasets, which is designed for machine learning practitioners, really to train their own models. Then there's Hugging Face models, which is designed for machine learning practitioners, but also software engineers who don't want to have to think about what's under the hood. They just want to use a really good image classification or really good question answering model and not really worry about any of the algorithmic implementation details. And so that opens it up to a lot more people. And then with Gradio or Spaces, which is what Hug Face calls demos, that level of access opens up even more. So now pretty much anyone who can use a browser, like you said, billions of people who have a browser and are connected to the Internet can now use state of the art machine learning models and they can do interesting things with that. And I'll just give maybe two quick examples. One is we had this demo that someone built with Gradio called Animegan and we've seen many, many such examples. But Animegan was this demo that you could put your own image or put any image and it would render it into this cartoonized almost, I think it's called Rotoscoped or drawn version of that image. And someone built a demo host with Gradio, hosted on Hugging Face Spaces, which is a place you can host your radio demos for free, and then released it on Twitter where it went viral.
I remember it, yeah.
And we had thousands of people use the model, I'd say maybe tens of thousand, and tried on their own profile pictures, pictures of their pets, everyday objects, and they were interacting with actually state of the art machine learning, which is something that's never been done before. That is really cool because now machine learning developers are thinking, hey, the audience who's using my model is a lot bigger. Let me make sure that my models are robust. They can handle diverse images, diverse inputs. That leads to a level of, I think, concern for the end user that wasn't really there before. I think that's really important because then issues of bias and accessibility are addressed as well. I want to give one other example as well, because I think this is interesting as well, because demos have a big purpose for education as well. And I remember one of the early days of Gradio, actually we had built like this demo for an MNIST model. And I actually shared this and this MNIST model, you can draw handwritten digits and you can see what the prediction of the model is. And I shared it with my sister, my younger sister, who has no background in machine learning whatsoever. And she tried using the model and she drew a six and it predicted six and all that work. And then she Just drew a little dot in the center and I think it predicted like a seven. And she was like, why didn't I predict a seven? That makes no sense. I just drew a dot. And then I told her, well, it kind of has to predict something. And maybe the sevens were just the most common thing in the data set. And she was like, that doesn't seem right. So then I was like, well, what should I do? And she said, well, it should just avoid making a prediction and it should kind of abstain from making a prediction. And so she had stumbled upon this idea of abstention, which is now a really important topic. A lot of people think about that. But if you've never really interacted with a machine learning model in this way, you might not even realize the importance of it. And this is someone who has no background in machine learning. So I think demos, I think go a really far way in both accessibility and then also education as well.
So I love that. I actually like to dig in. Having gone through those two examples and dig in just a little bit, it really begs the question of what typical workflows look like, because you've kind of shown us two examples of kind of going out there and doing that. And that second one in particular there was a big insight, you know, because we're all in this industry and I think there's some things we take for granted because we've been doing it for a while. But you had someone who wasn't someone important in your life who was not in the industry make you realize something. And I think we all have moments like that. What are some of the typical ways that you and your team and other people that you work with are using radio on a day to day basis that that has like directly changed the way the workflow is. Where do you fit this in? If I'm, if I'm adding radio into my machine learning, I'm already maybe using hugging face, but I now want to use radio as part of that. What's changed and how do I think about my workflow now?
Yeah, absolutely. Let me give maybe one more example. I think that might illustrate that and then we can kind of discuss that. So this was actually one of the early examples of gradient where I realized it could actually have a big impact, especially in interdisciplinary teams. And so I was building a machine learning model to classify ultrasound images of the heart, so echocardiograms, if you're familiar with them. And so we had built this model and it was getting really good accuracy, like 95% AUC and all this good stuff to predict various things about the heart. For example, does this patient have a pacemaker in their heart or not? And so we had built this model and we shared it with a cardiologist. And the cardiologist was a little skeptical about how well the model was working. And so we built a radio demo around it and we let him play around with it. And one of the things you can do with a radio demo is you can interactively edit the input so the cardiologist can upload his own ultrasound image in this case, and they can kind of edit it. And so they could, for example, remove the pacemaker from the image by like white, you know, kind of white outing it. And so he did that. And so there was a pacemaker ultrasound. The model was predicting this patient as a pacemaker. Then the cardiologist whiteouted it, removed it, and then the predictions change in real time. And when the cardiologist saw that and did this with a few different images, he was like, wow, this actually works. This actually works. And even us, all of the machine learning people in the room, we all breathed a sigh of relief. Because one thing to see aggregate metrics, but it's another thing to have someone adversarially test your model. And then it's still, you know, it's kind of robust to that, basically. I think there's two broad ways that gradio can help. And one is if your model is good, it can help build trust in the model, especially for important stakeholders, because they can test it. But if your model is bad, and this is maybe more important, if your model is bad, it can help expose those issues of bias and other things that are, that are really important as well.
I had a little follow up, and you're starting to address it there at the end already. But I'm curious, and it's a little bit of a side issue. It's not a direct radio issue. But the gradio is obviously part of the solution to this. And that is that several times in our conversation we've mentioned the idea of people being skeptical of model output and like, I don't know, and all that. And obviously you've seen that and you're addressing it and you have, you've produced a really good tool for letting people get that. But I'm curious, as someone who's observed that repeatedly, what is it that's causing the skepticism, entrusting the model? And obviously they get to a point where the tangibility of using radio allows them to get past that. But what do you think is causing the challenge the non machine learning consumer of that model is facing up front?
Well, I think you only have to look at some of these very famous models. You look at something like GPT3, for example. OpenAI released this model. It's supposed to be able to understand language and answer your questions. But people try it and they discover all sorts of problems, right? So you can ask it questions and it starts making very nonsensical kind of responses or you know, it even suggests very dangerous things. I remember there was a study like that showed that if you ask it medical questions it could suggest things that could lead to self harm and all these terrible things. And I myself was part of a study, I did a study where we were looking at bias and kind of religious bias and found that GPT3 has all these issues associating for example Muslims with violence and all of these kind of problematic things. And that's just one example. And so OpenAI did something interesting which is that they did release it as a demo so that people could try it out. But that doesn't happen most of the time with research, right? So you see all of these really nice sounding numbers and like state of the art this and that and nice models published in Nature that claim to have solved this problem. I remember actually there was one person I talked to at, when I was a PhD student at Stanford and she had made this really nice model to look at videos of people at ic kind of in the icu. And from those videos you could tell if a patient had a particular disease based on how they were moving around. And as she published in Nature, and I was like, oh, this is really cool, we should try to deploy this in the clinic. And then she looked at me, she was like, are you crazy? I would never trust this in the clinic because there's a big gap between I think what is, you know, publishable and sometimes what people can get away with versus what is actually usable in the real world for all of the reasons that we've talked about. Usually models are trained and tested on these really nice sanitized data sets and we don't really expect to test them on kind of real world settings that might be out of distribution. And so I think one of the cool things about radio and we're seeing this more and more is researchers. For example, at CBPR 2022 they published papers and they released accompanying radio demos and then the research community was testing them and there were some models that did great. Like people were testing them all sorts of difficult ways and they were doing great. And then other models, people found holes relatively quickly. And so I think part of it is because, you know, the machine learning community is so accustomed to training and testing on these very fixed benchmarks. That really, really stresses the need for something like Gradio to open that up, open up that box and let other people tie it with their own.
Well, I definitely want to follow up on some things related to Hugging Face plus Gradio, but maybe from a different perspective, I'm wondering as you were sort of running Gradio pre hugging face and you had the open source project and in certain ways you might not have known all the ways that people were using Gradio, but had some sense of how it was useful. And now you've kind of got this hugging face scale of people using it and an avenue for people to share things, and they're sharing a lot of things. What sorts of maybe challenges have you faced as you've tried to integrate Gradio at like hugging face scale and tried to like, you know, scale that up, make sure it runs well for like people as they create their own spaces with all sorts of different models, some which might be really big and some which might be like, pretty easy to run. I just imagine that that's kind of, well, a really hard thing to do, but it seems like you've done it very well.
So.
Yeah.
Any thoughts there?
Yeah, that's a good question. There's a lot here. So one of the things that amazed by is just like the diversity in the types of models that people are building. This is shocking. I think sometimes you can be kind of an echo chamber. You think, okay, most people use machine learning for these types of use cases. But then you see users that just completely blow your mind. So, for example, people using Gans to generate Pokemon or people using speech recognition in so many other languages. And you have to realize you have to support Unicode this and that. It's just a lot of different use cases that show up and you have to kind of address that. I think in terms of. So one of the good things about Gradio, I talked earlier about how there's like two different cycles of machine learning. There's kind of the exploratory research stage and then there's actual kind of production level type stuff. So at Gradio we tend to focus more on the exploratory research side. And so even when you share a model, let's say on spaces, or you share it temporarily. So I don't know if you've seen this, but if you create a Gradio demo, you can pass in one extra parameter in the launch function, share equals true. And that creates this temporary public link that allows anyone to access your model, which is super, super handy for prototyping. And so what we've entirely focused on, we've said we're not trying to optimize for production level traffics or anything like that. We want to just focus on, hey, let a few people try out your model, get feedback that a few other people try to model. And so that because we've kind of laser focused on that use case, even when a lot of other people are using radio demos, we have like always stayed with that expectation. So for example, people ask us, oh, my space is up on Hugging Face, I want to use it as an API. Well, we added support for that. We kind of made it clear, hey, this is not meant to be like a production level API. You can use it for testing and so on. So I think we've mitigated a lot of like traffic type related issues just by focusing on this stage of the use case. And then the other thing that we've tried to do is leverage Hugging Face's existing infrastructure as much as possible. So for example, Hugging Face already has something called the Inference API. So any sort of model that you can find on the Hugging Face hub, which at this point is, I think, more than 30,000 different models, it comes with its own inference API that you can just call. So Grady also supports using any of the models in the Hugging Face hub pretty much off the shelf. So in one line of code you can build a demo for one of these models and if you do it, it leverages Hugging Face's existing inference API rather than trying to create something ourselves. So by doing that, I think we've mitigated a lot of those load issues. But what we definitely find is a lot of people using Radio in these different use cases that we wouldn't even imagine. We see a lot of issues being raised and then we're doing our best to support that. A lot of cool things people ask for new types of components as well. So we're working on supporting that. A lot of people ask for. Like we're using this space to test our model. We're seeing some kind of weird behavior. How do we kind of retrain the model based on what kind of issues have been observed? So we're thinking about how to fit gradient into kind of this larger loop of training models again and making them better as well. So yeah, a lot of cool things there.
I'M synced with you pretty well, I think, because you're already going where I was going to ask you actually. And that is as you talk about these new components that you're building and you've talked about kind of focusing more on the exploratory side of that, but you've already acknowledged that there's the kind of the production deployment side. Is that where you want to go? It seems like it might be a natural workflow that if I'm already doing radio and getting my feedback with my demos and everything, that I might ultimately just want to deploy that in a variety of areas. And so as you build more components out is that with that in mind of eventually you are robust enough in how you're making that model available so that you can that it's Gradio all the way and forevermore.
Yeah, it's interesting we're thinking about that and right now we're actually leaning against that a little bit. And the reason for that is because that space is first of all very crowded. There's a lot of tools that are designed to help you deploy your model. And it's kind of an interesting. The issue is it's one of those things, it's kind of like, I would say like, kind of like the Heroku type problem, which is that if people get big enough, they don't want to use your solution to deploy, they want to do it themselves. If people are small like they want to. So there's a lot of people who are just prototyping great. So we've got that use case covered. When people are big, like kind of medium sized, maybe they'll use like an off the shelf product to deploy your model. When they're very big, they're going to write something themselves or use something that's kind of very tightly coupled with one of the big cloud vendors. And so we're actually thinking that rather than focusing on the production kind of production use case, which is kind of crowded, what we should do instead is make it easier to build more kinds of web applications from Python itself. And so I think we're going to be leaning more in that direction. You'll see things like potentially solutions for maybe lightweight labeling solutions built out of Gradio or maybe data set exploration tools built out of Gradio trying to cover more of those use cases.
Love the focus there.
And as you look towards that, I also note that I believe, if I'm not mistaken, the sort of main core of Gradio is open source. I don't know if there's certain things that are maybe integration things with Hugging Face and other things that aren't. But the main bit is I'm wondering how that community has grown over, over time and the sort of code base and open source community, what you're seeing in terms of activity and interest there.
Yeah, that's been amazing and we obviously owe a lot to Hugging Face for that. So like for example, we have a Discord server. I think if we had just launched for Gradio Discord Server, I don't know how many people would have joined. But we're part of the Hugging Face Discord server, which helps a lot. And our community is honestly amazing. There's some folks, and this astounds me, there's some folks that use Gradio every day and they're like raising new issues, like I don't use Gradient every day, you know. So it's been really nice. People catch issues like that. Anytime we break anything, people let us know. But I think one of the very interesting developments that we're seeing and we're trying to understand this piece better, is that people used to just have demos as kind of standalone things, but now people are taking demos and integrating it onto their websites, like as part of their portfolios, but even just as like standalone websites. So one of our users, for example, built this NFT search engine using the back end of it is a Gradio app. He hosted it on spaces and just like embedded that spaces on the homepage of his website. And so his whole website, I mean it has some surrounding information, but it's basically a Gradio demo, which is very interesting. I mean, you know, if. And this is not the only one, we've seen this in a few different examples and this kind of raises the question. So now it seems like a lot of people are building very data centric or machine learning centric applications. That's like the focus of it. If there's enough use cases like this, maybe we want to focus on building kind of this one stop shop for how to build a complete data centric application. So we're thinking about that as well.
I work with a lot of students from Purdue University, have a close collaboration there, and other universities as well. And they're always asking me as I'm going from grad school into industry, what can I do to set myself apart. I think for those of you listening out there that are listening to this, this is a really cool idea that can set you apart if you're able to go past saying, hey, I ran this Cool example in my Jupyter notebook. And here's the GitHub repo with the Jupyter notebook. Okay. It renders and I can see some images. It's a whole nother level when you can point someone to spaces or to a Gradio app, or embed that in a blog post or your website or whatever and have someone actually interact with it. I think that that like goes a long way. We get a lot of requests from people listening to the podcast and in our own lives about like people getting into AI and data science. And I think just, that's just a general like free, free tip out there. I think this, this episode has, has.
Shown that it really differentiates that person from all the competition. And, and I know that in my own organization we see that as well as people are coming in if you walk in and you're a radio expert compared to people who are not able to show that. It's a huge differentiator for someone. So yeah, it's a great point you're making there.
Yeah, that's a lot of fun.
It is a lot of fun.
Yeah. Just to be able to interact with your model. It's just so much more real. As we've talked about, you start noticing these things that you otherwise would just not have even paid attention to. A lot of things are just buried under these nice aggregate metrics that we like to take a look at. We just get way more insight when you can actually play around with your model.
And as you look to kind of the future of Gradio and Hugging Face and maybe like other things that are happening with those two things, what are some of the things that are exciting to you about maybe the AI space more generally and then maybe more specifically in Hugging Face and Gradio world, like what are you thinking about that you're super excited about the developments of and looking forward to the future?
Yeah, absolutely. So I think one thing that really excites me is that we are moving away from this, like what we've talked about, you know, this, this benchmarking on these static data sets and that's it. Now a lot more people are interested in out of distribution robustness. Right. Like, we've trained a great model on our data set. What kind of guarantees can we give about how well it's going to perform in the real world? Obviously it's a very difficult topic, but there's a lot more interest both on the academic side and then also on the industry side with practical tooling. And so this is where I think we're going to see companies potentially including Hug Face, also invest more resources in like you have some models out there. How can you effectively flag issues that the model is having so that other people who use it are aware of these limitations can contribute to the robustness of the model? Because I do think at the end of the day it's a problem that's probably going to be. It's very hard, I think, to formulate this problem in a clean way such that we can tackle it from a theoretical point of view or an academic point of view. I think what we need are better tools to identify issues behind models and to let people almost just the same way GitHub, for example, has issues and PRs, what is the equivalent of that for machine learning look like so that people are kind of aware of the issues and can make things better. So that's something I'm personally very excited by. I think Gradio plays a role with that in helping discover these issues. But I think it's a much bigger problem just alone that Radio can solve.
Yeah, and you mentioned even we didn't go into it in detail, but you do have this flagging feature within the app. Could you maybe tie in how you see that fitting into what you're talking about with this out of distribution input and that sort of thing?
Yeah, absolutely. So this is one of the core fundamental things that we added to Gradio early on and we see people using it very actively to this day, which is that gradient lets you try out your own data in potentially someone else's model or your own model. You can put it, you can drag and drop your own image, you can type your own text, you can edit it, you can play around with it. And let's say you find something that the model isn't working well on, let's say, I mean, just for an example, if you take a state of the art image classifier and you put in a picture of a bride who's wearing western attire, like American, let's say, you know, typical. It predicts bride, bride or ceremony. You know, pretty reasonable labels. But if you put in a picture of a bride from Pakistan, where I'm from, or India or wearing something, it usually predicts things like costume or performance or something that's, you know, could be, that's wrong, maybe could be borderline offensive as well. You know, you find issues like this all the time with all sorts of machine learning models. As we've talked about, they're very fragile. And so what this flagging button lets you do is it saves that sample and it stores it to a local database in like a CSV file, basically. And so the workflow, what this looks like in practice, and we see this often, is people will create a radio demo and they'll share it because it's so easy to share that demo. It's like just like a link, like a Google Drive link. You share it with a bunch of people, they try out your model, they identify issues and that helps you. And then they can just click the flag button. That's all they have to do. And then you have this nice CSV of everything that's been flagged and you can say, ah, okay, maybe I should retrain my model on these samples. Or maybe I have some better understanding of what the failure points are. We have users who used to like, you know, have spreadsheets where they would send these spreadsheets back and forth over email. It's kind of a replacement for that and maybe a better way to do it.
Yeah, I think this is super important. And yeah, I'm just really excited about the future with these sorts of tools and what you're doing. Keep up the good work. Really appreciate you taking time out of your. Your busy gradio hugging face life to. To let us know about these things. It was a pleasure talking. Hope to talk again soon.
Yeah, it was great. Thank you so much for having me here and all the great questions. All right, bye.
Bye.
All right, that is Practical AI for this week. If this is your first time listening, subscribe now at PracticalAI FM or just search for Practical AI in your favorite podcast app. We're in there. And if you're a longtime listener, please do share the show with your friends. It is the best way you can help Practical AI succeed. Thanks again to Fastly for shipping our shows super fast all around the world to break master cylinder for the beats. And to you for listening. We appreciate you. That's all for this week. We'll talk to you again next time.
Sam.
More from LARRUZ


Ep 881: Faster AI Agents, Fewer Human Coworkers: The Overly Productive Future of Managing Agents? (Replay)


Ep 879: New: OpenAI Presence. Has The AI Customer Service Takeover Finally Arrived? (Replay)


Ep 878: What’s Coming Next: 5 AI Trends, Problems and Opportunities around the Corner (Replay)




