cannot import name 'LocalContext' from 'gradio.context'
rizkidewanto opened this issue · comments
Hello. First of all, I want to say congrats to the dev. What an AI. I try the demo on HF, it's 🤯
I want to try running this locally, but encounter this error :
Traceback (most recent call last):
File "D:\WPy64-31090\notebooks\pm\app.py", line 10, in <module>
import spaces
File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\__init__.py", line 10, in <module>
from .zero.decorator import GPU
File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\decorator.py", line 17, in <module>
from . import client
File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\client.py", line 17, in <module>
from .gradio import get_event
File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\gradio.py", line 8, in <module>
from gradio.context import LocalContext
ImportError: cannot import name 'LocalContext' from 'gradio.context'
Help is appreciated, thanks.
Using this project to run it on Windows:
https://github.com/bmaltais/PhotoMaker/tree/v1.0.1
Ok, will notify if anything goes wrong again. Thanks.
Ok, I got it running on Colab (sad PC can't run it).
However, I got message torch.cuda.OutOfMemoryError: CUDA out of memory. How to fix it?
The minimum GPU memory required by our PhotoMaker is 15G. You could apply other GPU
An important note: For those GPUs that do not support bfloat16, please change this line to torch_dtype = torch.float16, the speed will be greatly improved (1min/img (before) vs. 14s/img (after) on V100). The minimum GPU memory requirement for PhotoMaker is 15G.