Trying to run a space locally

Hi, I’m trying to run this Space locally:
HF /spaces/radames/Enhance-This-HiDiffusion-SDXL

I’m on Windows 11 Pro, I have the required version of Python and my GPU is Nvidia 4090. I’m following the suggested steps:

  1. git lfs install
  2. git clone Enhance This HiDiffusion SDXL - a Hugging Face Space by radames
  3. python -m venv .env
  4. …env\Scripts\activate
  5. pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
  6. pip install -r requirements.txt
  7. pip install mediapipe
  8. pip install streamlit
  9. streamlit run app.py

The result:

You can now view your Streamlit app in your browser.

Local URL: localhost:8501
Network URL: 192.168.1.30:8501

2024-05-26 19:11:06.061 Uncaught app exception
Traceback (most recent call last):
File “C:\Enhance-This-HiDiffusion-SDXL.env\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 600, in run_script
exec(code, module.dict)
File “C:\Enhance-This-HiDiffusion-SDXL\app.py”, line 1, in
import spaces
File “C:\Enhance-This-HiDiffusion-SDXL.env\lib\site-packages\spaces_init.py”, line 10, in
from .zero.decorator import GPU
File “C:\Enhance-This-HiDiffusion-SDXL.env\lib\site-packages\spaces\zero\decorator.py”, line 21, in
from .wrappers import regular_function_wrapper
File “C:\Enhance-This-HiDiffusion-SDXL.env\lib\site-packages\spaces\zero\wrappers.py”, line 15, in
from multiprocessing.context import ForkProcess
ImportError: cannot import name ‘ForkProcess’ from ‘multiprocessing.context’ (C:\Users\lirex.pyenv\pyenv-win\versions\3.10.11\lib\multiprocessing\context.py)

Any advise will be appreciated, thanks!

find wrappers.py in your spaces lib installation
for me it was F:\.conda\env\yourCondaEnvName\Lib\site-packages\spaces\zero\wrappers.py

replace Process = multiprocessing.get_context('fork').Process with
Process = multiprocessing.get_context('spawn').Process