Maybe this alone won't fix it completely, but it's a better fix than not doing it.

If you are stuck with the same bug I am reporting below, the only workaround on the user side is to isolate the function. The only sane solution is to just wait for it to be fixed.
https://huggingface.co/spaces/zero-gpu-explorers/README/discussions/104

DamarJati changed pull request status to merged

Screenshot_2024-09-02-19-54-35-64.jpg
Screenshot_2024-09-02-19-54-52-60.jpg

I still see a similar problem. Calling class methods with @spaces decorators from Gradio events almost always crashes.
Wrapping it in a function like the following may make it ok. However, it seems that the behavior of the bug changed again a few hours ago😭, so I don't know what's going on anymore...

Well, according to the HF staff, it is a bug and not a permanent specification, so I guess the right thing to do is to wait for it to be fixed.

        generate_btn.click(
            fn=xflux_pipeline.gradio_generate,

        @spaces.GPU()
        def gradio_generate(*args):
            return xflux_pipeline.gradio_generate(*args)

        generate_btn.click(
            fn=gradio_generate,

It seems like this issue is related to GPU usage. Try adding .to("cuda") to the pipeline.

My Python skills aren't very strong, so I'm looking for someone to help.

I don't have a long Python history, but I committed the above workaround anyway.
Yes, the problem was triggered by a spec change in the Zero GPU space, which made the problem more severe.
Most of the places that do .to(“cuda”) are now compromised, including probably inside the libraries.

P.S.
I tried to tweak it a bit, and it starts up, but the initialization inside the library seems to be causing a conflict with the HF problem, so the inference doesn't work...
I'm tweaking my space anyway, so I'll come back to reflect if I find a workaround.
It would be great if the HF glitch could be fixed before then!

Zero GPU issue Fixed!

https://huggingface.co/spaces/zero-gpu-explorers/README/discussions/104#66db15e136aa505569dd6d0d

a major issue on ZeroGPU has just been fixed.
The issue could make Spaces stuck forever (thus leading to "GPU task aborted"), as well as prevent Gradio modals and progress to display (which seems to be linked to your original message)

To benefit from the fix, all you need to do is push a change to your Space in order to trigger an update of the spaces package (note that "Restart" or "Factory rebuild" won't trigger the update)

Sign up or log in to comment