Spaces:
Sleeping
Sleeping
[Update]use custom_css to display
Browse files
app.py
CHANGED
|
@@ -16,6 +16,17 @@ is_spaces = True if "SPACE_ID" in os.environ else False
|
|
| 16 |
|
| 17 |
is_shared_ui = False
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
def excute_udiff(diffusion_model_id, concept, attacker):
|
| 21 |
print(f"my IP is {myip}, my port is {myport}")
|
|
@@ -37,12 +48,16 @@ css = '''
|
|
| 37 |
'''
|
| 38 |
|
| 39 |
|
| 40 |
-
with gr.Blocks(css=
|
| 41 |
-
gr.
|
| 42 |
-
gr.Markdown(
|
| 43 |
-
|
| 44 |
-
#
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
with gr.Row() as udiff:
|
| 48 |
with gr.Column():
|
|
|
|
| 16 |
|
| 17 |
is_shared_ui = False
|
| 18 |
|
| 19 |
+
from css_html_js import custom_css
|
| 20 |
+
|
| 21 |
+
from about import (
|
| 22 |
+
CITATION_BUTTON_LABEL,
|
| 23 |
+
CITATION_BUTTON_TEXT,
|
| 24 |
+
EVALUATION_QUEUE_TEXT,
|
| 25 |
+
INTRODUCTION_TEXT,
|
| 26 |
+
LLM_BENCHMARKS_TEXT,
|
| 27 |
+
TITLE,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
|
| 31 |
def excute_udiff(diffusion_model_id, concept, attacker):
|
| 32 |
print(f"my IP is {myip}, my port is {myport}")
|
|
|
|
| 48 |
'''
|
| 49 |
|
| 50 |
|
| 51 |
+
with gr.Blocks(css=custom_css) as demo:
|
| 52 |
+
gr.HTML(TITLE)
|
| 53 |
+
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
| 54 |
+
|
| 55 |
+
# gr.Markdown("# Demo of UnlearnDiffAtk.")
|
| 56 |
+
# gr.Markdown("### UnlearnDiffAtk is an effective and efficient adversarial prompt generation approach for unlearned diffusion models(DMs).")
|
| 57 |
+
# # gr.Markdown("####For more details, please visit the [project](https://www.optml-group.com/posts/mu_attack),
|
| 58 |
+
# # check the [code](https://github.com/OPTML-Group/Diffusion-MU-Attack), and read the [paper](https://arxiv.org/abs/2310.11868).")
|
| 59 |
+
# gr.Markdown("### Please notice that the process may take a long time, but the results will be saved. You can try it later if it waits for too long.")
|
| 60 |
+
|
| 61 |
|
| 62 |
with gr.Row() as udiff:
|
| 63 |
with gr.Column():
|