text
Making gradio's auto-reload leaner and more robust 💪
Making gradio's auto-reload leaner and more robust 💪
new_line
new_line
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.
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
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.
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
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.
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
text
1. First, gradio's reload mode now works with the 
1. First, gradio's reload mode now works with the 
inline_code
`python-dotenv`
python-dotenv
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 
 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 
inline_code
`python-dotenv`
python-dotenv
text
 package last night! Thanks to 
 package last night! Thanks to 
mention
@theskumar
theskumar
text
, maintainer of python-dotenv, for all the help. 
, maintainer of python-dotenv, for all the help. 
new_line
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 
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 
mention
@velaia
velaia
text
 for filing the issue and 
 for filing the issue and 
mention
@abidlabs
abidlabs
text
 for the review!
 for the review!
new_line
new_line
text
More improvements to reload mode are planned. Stay tuned!
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