gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.58k stars 2.45k forks source link

Weird Looping Behavior on Windows10 only #4326

Closed x-CK-x closed 1 year ago

x-CK-x commented 1 year ago

Describe the bug

I've tested on both linux & windows and I'm only getting this issue on windows. It loops when calling functions from instantiated objects from other local files with the respective classes.

It loops any code in the main script with the defined components.

Is there an existing issue for this?

Reproduction

https://github.com/x-CK-x/Dataset-Curation-Tool/wiki

Either downloading any data and/or trying to run inference with the captioning model creates this looping behavior with code in the webui.py script.

I did try upgrading it to gradio==3.32.0, but on windows10 the issue persists the issue is OS related using gradio, but the loop behavior specifically happens when a function is called from a previously instantiated object in the webui.py.

Screenshot

No response

Logs

n/a, no error/s or warning/s

System Info

3.29.0 but I also tested with 3.32.0
Windows10 (looping issue present) but with Ubuntu no issues

Severity

blocking all usage of gradio

abidlabs commented 1 year ago

Hi @x-CK-x can you provide a simpler repro than running the entire webui? A simpler code snippet that we could run the reproduce the looping behavior you describe?

x-CK-x commented 1 year ago

windows doesn't have a fork sys-command like linux. I wouldn't have found out this issue, but someone pointed it out: https://github.com/x-CK-x/Dataset-Curation-Tool/issues/4

the only solution is when designing around a UI with gradio, to wrap everything in a function and any initialization functions get called in the main == name, otherwise anyone is prone to this happening.