Spaces:
Sleeping
Sleeping
Commit History
-
fix: use a plain module-level @spaces.GPU function, not a bound method
Decorating InferenceEngine.run_user_file directly was wrong: ZeroGPU forks a worker process and sends the call's args through a pickled multiprocessing queue. Since it's a bound method, `self` (the whole engine, including the loaded HAT model) got pickled and sent across that boundary. ZeroGPU's disk-offload tracking keys off the *original* tensor objects, so the unpickled copy in the worker was never recognized/materialized onto the GPU — conv2d kept hitting a placeholder tensor, same error as before. Add a plain top-level run_gpu_inference(file_path, model_name) that takes only small picklable arguments and reaches the model through the module-level `inference_engine` global, which the forked worker inherits for free via fork() instead of pickling. Both the Gradio handler and the REST /api/upload endpoint now call this single shared entrypoint (the latter via run_in_threadpool, since it's async and the call blocks on GPU scheduling). Co-Authored-By: Claude Sonnet 5 <noreply@anthrop…8ac6b2e -
chore: add app files
7529108