Making gradio's auto-reload leaner and more robust 💪
text
Making gradio's auto-reload leaner and more robust 💪
new_line
new_line
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.
text
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.
new_line
new_line
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.
text
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.
new_line
new_line
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.
text
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.
new_line
new_line
1. First, gradio's reload mode now works with the 
text
1. First, gradio's reload mode now works with the 
python-dotenv
`python-dotenv`
inline_code
 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 
text
 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
`python-dotenv`
inline_code
 package last night! Thanks to 
text
 package last night! Thanks to 
@theskumar
mention
theskumar
, maintainer of python-dotenv, for all the help. 
text
, maintainer of python-dotenv, for all the help. 
new_line
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 
text
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
mention
velaia
 for filing the issue and 
text
 for filing the issue and 
@abidlabs
mention
abidlabs
 for the review!
text
 for the review!
new_line
new_line
More improvements to reload mode are planned. Stay tuned!
text
More improvements to reload mode are planned. Stay tuned!
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!
❤️
clem abidlabs osanseviero victor vladbogo gsarti samusenps radames chansung akashicmarga mathiasn1 Dlbk Wauplin kramp clefourrier velaia hysts
🤝
abidlabs osanseviero clem radames chansung ashwinlimaye