Skip to content
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

Weird Looping Behavior on Windows #4

Closed
luvoid opened this issue May 23, 2023 · 1 comment
Closed

Weird Looping Behavior on Windows #4

luvoid opened this issue May 23, 2023 · 1 comment

Comments

@luvoid
Copy link
Contributor

luvoid commented May 23, 2023

Describe the bug

Tested on both linux & windows. Only getting this issue on windows. It loops when calling functions from instantiated objects from other local files with the respective classes.

Reproduction

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.

Tried 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.

  • so with the batch_downloader class, running the download button
  • as well as the the auto_tag class, running the interrogate button
@luvoid
Copy link
Contributor Author

luvoid commented May 23, 2023

Possible Cause Identified

Windows doesn't have a fork sys-command like Linux does. Python works around this by starting a new process, importing all scopes up to where the mp.Process was created, and continuing from there.

webui.py was using multiple processes, but the code that builds the Gradio UI is just sitting in webui.py, so everytime webui.py is imported, the UI hooks were created again.

tl;dr, every time mp.Process is called, webui.py is started from the beginning again in a new process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants