Update
Browse files
app.py
CHANGED
@@ -17,9 +17,10 @@ DESCRIPTION = '# [DDNM-HQ](https://github.com/wyhuai/DDNM/tree/main/hq_demo)'
|
|
17 |
|
18 |
if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
|
19 |
DESCRIPTION += f'\n<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a></p>'
|
|
|
|
|
20 |
|
21 |
if torch.cuda.is_available():
|
22 |
-
DESCRIPTION += '\n<p>Running on GPU 🔥</p>'
|
23 |
MODEL_DIR = pathlib.Path('DDNM/hq_demo/data/pretrained')
|
24 |
if not MODEL_DIR.exists():
|
25 |
MODEL_DIR.mkdir()
|
@@ -31,8 +32,6 @@ if torch.cuda.is_available():
|
|
31 |
'wget https://openaipublic.blob.core.windows.net/diffusion/jul-2021/256x256_diffusion.pt'
|
32 |
),
|
33 |
cwd=MODEL_DIR.as_posix())
|
34 |
-
else:
|
35 |
-
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.'
|
36 |
|
37 |
with gr.Blocks(css='style.css') as demo:
|
38 |
gr.Markdown(DESCRIPTION)
|
|
|
17 |
|
18 |
if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
|
19 |
DESCRIPTION += f'\n<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a></p>'
|
20 |
+
if not torch.cuda.is_available():
|
21 |
+
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
|
22 |
|
23 |
if torch.cuda.is_available():
|
|
|
24 |
MODEL_DIR = pathlib.Path('DDNM/hq_demo/data/pretrained')
|
25 |
if not MODEL_DIR.exists():
|
26 |
MODEL_DIR.mkdir()
|
|
|
32 |
'wget https://openaipublic.blob.core.windows.net/diffusion/jul-2021/256x256_diffusion.pt'
|
33 |
),
|
34 |
cwd=MODEL_DIR.as_posix())
|
|
|
|
|
35 |
|
36 |
with gr.Blocks(css='style.css') as demo:
|
37 |
gr.Markdown(DESCRIPTION)
|