Spaces:
Sleeping
Sleeping
Nupur Kumari
commited on
Commit
•
4b2c52c
1
Parent(s):
8173ae1
concept ablation
Browse files- app.py +7 -4
- models/grumpy_cat_delta.bin +3 -0
- models/r2d2_delta.bin +3 -0
app.py
CHANGED
@@ -6,14 +6,17 @@ from trainer import train_submit, inference
|
|
6 |
|
7 |
import os
|
8 |
model_map = {'Van Gogh' : 'models/vangogh_ablation_delta.bin',
|
9 |
-
'Greg Rutkowski' : 'models/greg_rutkowski_ablation_delta.bin',
|
|
|
|
|
10 |
}
|
11 |
|
12 |
ORIGINAL_SPACE_ID = 'nupurkmr9/concept-ablation'
|
13 |
SPACE_ID = os.getenv('SPACE_ID')
|
14 |
|
15 |
-
SHARED_UI_WARNING = f'''## Attention - the demo requires at least 24GB VRAM for
|
16 |
-
<center><a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="margin-top:0;margin-bottom:0" src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></center
|
|
|
17 |
'''
|
18 |
|
19 |
sys.path.append("concept-ablation-diffusers")
|
@@ -54,7 +57,7 @@ class Demo:
|
|
54 |
with gr.Column(scale=1):
|
55 |
|
56 |
self.prompt_input_infr = gr.Text(
|
57 |
-
placeholder="
|
58 |
label="Prompt",
|
59 |
info="Prompt to generate"
|
60 |
)
|
|
|
6 |
|
7 |
import os
|
8 |
model_map = {'Van Gogh' : 'models/vangogh_ablation_delta.bin',
|
9 |
+
'Greg Rutkowski' : 'models/greg_rutkowski_ablation_delta.bin',
|
10 |
+
'R2D2' : 'models/r2d2_delta.bin',
|
11 |
+
'Grumpy Cat' : 'models/grumpy_cat_delta.bin',
|
12 |
}
|
13 |
|
14 |
ORIGINAL_SPACE_ID = 'nupurkmr9/concept-ablation'
|
15 |
SPACE_ID = os.getenv('SPACE_ID')
|
16 |
|
17 |
+
SHARED_UI_WARNING = f'''## Attention - the demo requires at least 24GB VRAM for training. Please clone this repository to run on your own machine.
|
18 |
+
<center><a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="margin-top:0;margin-bottom:0" src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></center>
|
19 |
+
This demo is partly adapted from https://huggingface.co/spaces/baulab/Erasing-Concepts-In-Diffusion.
|
20 |
'''
|
21 |
|
22 |
sys.path.append("concept-ablation-diffusers")
|
|
|
57 |
with gr.Column(scale=1):
|
58 |
|
59 |
self.prompt_input_infr = gr.Text(
|
60 |
+
placeholder="a house in the style of van gogh",
|
61 |
label="Prompt",
|
62 |
info="Prompt to generate"
|
63 |
)
|
models/grumpy_cat_delta.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2a777d601c1930a88173f4e4a555244f5916576dbf2523277e047c4ede53510c
|
3 |
+
size 76685761
|
models/r2d2_delta.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:22ef614bbb66fa68689b1708f19883f3ad1cda05a90c77a354b9a898593602bc
|
3 |
+
size 76685761
|