Hugging Face 发布 Gradio 5 稳定版,主打生产级机器学习 Web 应用
Welcome, Gradio 5
Hugging Face 宣布 Gradio 5 稳定版发布,开发者可用几行 Python 构建面向生产环境的机器学习 Web 应用。新版本通过服务端渲染(SSR)提升加载速度,对按钮、标签页、滑块和聊天机器人界面做了设计更新,并加入低延迟流式能力,覆盖摄像头目标检测、视频流、实时语音转写与生成等场景。
We’ve been hard at work over the past few months, and we are excited to now announce the stable release of Gradio 5.
With Gradio 5, developers can build production-ready machine learning web applications that are performant, scalable, beautifully designed, accessible, and follow best web security practices, all in a few lines of Python.
To give Gradio 5 a spin, simply type in your terminal:
pip install --upgrade gradio
and start building your first Gradio application.
Gradio 5: production-ready machine learning apps
If you have used Gradio before, you might be wondering what’s different about Gradio 5.
Our goal with Gradio 5 was to listen to and address the most common pain points that we’ve heard from Gradio developers about building production-ready Gradio apps. For example, we’ve heard some developers tell us:
- “Gradio apps load too slowly” → Gradio 5 ships with major performance improvements, including the ability to serve Gradio apps via server-side rendering (SSR) which loads Gradio apps almost instantaneously in the browser. No more loading spinner! 🏎️💨
"This Gradio app looks old-school" → Many of the core Gradio components, including Buttons, Tabs, Sliders, as well as the high-level chatbot interface, have been refreshed with a more modern design in Gradio 5. We’re also releasing a new set of built-in themes, to let you easily create fresh-looking Gradio apps 🎨
“I can’t build realtime apps in Gradio” → We have unlocked low-latency streaming in Gradio! We use base64 encoding and websockets automatically where it offers speedups, support WebRTC via custom components, and have also added significantly more documentation and example demos that are focused on common streaming use cases, such as webcam-based object detection, video streaming, real-time speech transcription and generation, and conversational chatbots. 🎤
"LLMs don't know Gradio" → Gradio 5 ships with an experimental AI Playground where you can use AI to generate or modify Gradio apps and preview the app right in your browser immediately: https://www.gradio.app/playground
Gradio 5 provides all these features while maintaining Gradio’s simple and intuitive developer-facing API. Since Gradio 5 intended to be a production-ready web framework for all kinds of machine learning applications, we've also made significant improvements around web security (including getting a 3rd-party audit of Gradio) -- more about that in an upcoming post!
Breaking changes
Gradio apps that did not raise any deprecation warnings in Gradio 4.x should continue to work in Gradio 5, with a small number of exceptions. See a list of breaking changes in Gradio 5 here.
What’s next for Gradio?
Many of the changes we’ve made in Gradio 5 are designed to enable new functionality that we will be shipping in the coming weeks. Stay tuned for:
Multi-page Gradio apps, along with native navbars and sidebars
Support for running Gradio apps on mobile using PWA and potentially native app support
More media components to support emerging modalities around images and videos
A richer DataFrame component with support for common spreadsheet-type operations
One-line integrations with machine learning model and API providers
Further improvements that will decrease the memory consumption of Gradio apps
And much more! With Gradio 5 providing a robust foundation to build web applications, we’re excited to really get started letting developers build all sorts of ML apps with Gradio.
Try Gradio 5 right now
Here are some HF Mirror Spaces that are running Gradio 5:
来源:Hugging Face Blog · hf-mirror.com