Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
freddyaboulton 
posted an update Jan 23
Post
Making gradio's auto-reload leaner and more robust 💪

Auto-reload is one of the coolest (and maybe underrated) features of gradio in my opinion. It automatically detects changes in your python app file and hot swaps your backend and frontend without restarting the server. I may be biased, but that's a way nicer experience than most other reload mode features out there.

This is all possible due to novel use of python's built in importlib module. Since this is a non-standard use of the module, our users have encountered some rough edges in the wild.

I'm happy to announce two improvements that will be out in the next release of gradio. They were both made possible by collaboration in the open source community.

1. First, gradio's reload mode now works with the python-dotenv library. Getting to the bottom of this one took a lot of sleuthing by our users and the fix got merged and released into the python-dotenv package last night! Thanks to @theskumar , maintainer of python-dotenv, for all the help.
2. Second, gradio's reload mode now consumes an order of magnitude less CPU. Depending on how many files are in your source directory, you may see between 2x to 10x less CPU utilization. Thanks to @velaia for filing the issue and @abidlabs for the review!

More improvements to reload mode are planned. Stay tuned!
In this post