-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.42.0 breaks automatic reload after a change is detect #5402
Comments
Hi @mangiucugna we changed the way reload mode works, which may be leading to this. Can you share the code for |
Sure thing, the repo is public https://huggingface.co/spaces/mangiucugna/difficult-conversations-bot/tree/main just upgrade gradio to latest to reproduce |
Ok I have dug a bit deeper and the problem seems to be related to tiktoken, imported by langchain, that is importing the rust bindings, and those will definitely fail if reimported again. Tagging @freddyaboulton as he is the author of the PR. |
It seems that this bug is still unresolved. The same issue occurs in version 3.50.2.
|
It’s definitely a bug in tiktoken, but is triggered by the PR I mentioned above. Not sure it’s possible to fix without reverting that PR (or we all try to fix tiktoken but not sure if that’s a good use of our collective time) |
btw, so that we are clear, PyO3 does not consider this a bug. |
I think what we'll have to do is introduce a |
yeah I agree, I have been going back and forth on a possible solution but there are too many libraries that use Rust bindings (some also inside gradio through orjson) so a flag sounds right to me. |
happening for me as well |
@mangiucugna @GeorgeStrakhov Can you guys try developing in reload mode in a jupyter notebook if you are using libs with rust bindings? You I started implementing the |
I will try to make time in the coming days to test. I like the idea of reloading only some parts, in fact my understanding is that if we could just skip the imports the problem would be solved. |
Thank you! |
So I tried it, it worked fine this way. Not sure how this tests the reload feature for you but it worked as expected |
Thanks @mangiucugna - will think about how we can make reload mode work like a jupyter notebook from the command line after the 4.0 launch next week! |
+1 to please implementing this feature. Very cool system, otherwise. |
I faced the same issue, could you tell me how you solve this problem? I have no idea about how to add the |
An update here, the folks over at tiktoken have upgraded to the latest pyo3 that seems to solve this problem openai/tiktoken#141 I think now we need to wait for all rust-binded libraries to upgrade (orjson comes to mind for gradio) |
Any updates on this? Perhaps dependencies should be pinned to unaffected versions? |
I believe this should be resolved as of gradio==4.14.0. Can someone please let us know if that's not the case and provide a simple repro? |
just tried with latest and the error changed, so I guess progress :)
|
I'm still having the same issue as above, even on 4.14.0. |
Same issue on 4.15.0 code
gradio it, change the code and save, then the issue occur logs
|
Hi @zZxztxZz ! That's expected. Can you please create demo outside of a function. Something like demo = create_webui()
if __name__ == "__main__":
demo.launch(...) |
Thank you @freddyaboulton! I changed my code like this,and it won't crash when automatic reload. code
logs
|
I'm still having issues with not being able to autoreload, also with numpy @freddyaboulton code def create(): demo = create() if name == "main": |
Can you please share your code as well as the python and gradio versions your are using @yiyiiiiiii ? |
Hi all, I am working on a fix for this in #7684 . It introduces a
If you encounter any problems please share all code and library versions needed to reproduce so I can investigate. cc @mangiucugna |
Describe the bug
in Gradio 3.42.0 the autoreload when a change is detected breaks with an error and the only way to continue is to kill and restart gradio again.
My only action was to upgrade the package from 3.41.2 to 3.42.0 (side note: why those packages are not present in the releases in github?)
Have you searched existing issues? 🔎
Reproduction
Upgrade Gradio to 3.42.0 and run
gradio app.py
, then change something inapp.py
Screenshot
No response
Logs
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: