Gradio, a popular open-source Python framework for building machine learning demos, recently announced the release of version 5. This update includes significant performance improvements, including the ability to serve apps using server-side rendering (SSR). This means that Gradio apps will now load almost instantly in the browser, without displaying a spinning loading screen.
In previous versions of Gradio, apps were rendered client-side, meaning the user's browser was responsible for downloading and executing the app's code. This could lead to slow loading times for complex apps with many components. With SSR, the app's code is executed on a server, and only the rendered HTML is sent to the user's browser. This can significantly improve loading times, as the user's browser has less work to do.
In a recent tweet, Gradio announced that Gradio 5 "ships with major performance improvements, including the ability to serve apps via server-side rendering (SSR), making Gradio apps load almost instantly in the browser. No more spinning loading screen!"
In addition to performance improvements, SSR also offers a number of other benefits, including:
To enable SSR in Gradio 5, developers will need to have Node.js version 20 or higher installed and set the ssr_mode=True
parameter in the launch()
function. SSR is enabled automatically on Hugging Face Spaces for apps using Gradio 5.
Community reactions to the performance improvements in Gradio 5 have been positive. Users have reported significantly faster loading times, especially for complex apps. Many developers have praised Gradio's decision to implement SSR, as it is a major step towards building production-ready machine learning apps.
The ability to serve apps via SSR is a major performance improvement in Gradio 5. It will help make machine learning apps more accessible and responsive to users, while also improving SEO and accessibility. As Gradio continues to evolve, developers can expect even more performance improvements in the future.
github.com/gradio-app/gradio/issues/4841
github.com/gradio-app/gradio/issues/9463
www.gradio.app/guides/setting-up-a-demo-for-maximum-performance
gradio.app
www.gradio.app/changelog
discuss.huggingface.co/t/gradio-app-runs-slow-in-publik-link/27346
twitter.com/gradio?lang=de
www.gradio.app/docs/gradio/interface
www.cafiac.com/?q=node/188