Spaces:
Running
Running
[Update]Change backend of Gaudi
Browse files
app.py
CHANGED
@@ -11,8 +11,8 @@ from PIL import Image
|
|
11 |
|
12 |
# myip = os.environ["0.0.0.0"]
|
13 |
# myport = os.environ["80"]
|
14 |
-
myip = "
|
15 |
-
myport=
|
16 |
|
17 |
is_spaces = True if "SPACE_ID" in os.environ else False
|
18 |
|
@@ -110,7 +110,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
110 |
label="Unlearning undesirable concepts")
|
111 |
with gr.Column():
|
112 |
# gr.Markdown("Please upload your model id.")
|
113 |
-
drop_model = gr.Dropdown(["ESD", "FMN"
|
114 |
label="Unlearned DMs")
|
115 |
# diffusion_model_T = gr.Textbox(label='diffusion_model_id')
|
116 |
# concept = gr.Textbox(label='concept')
|
@@ -130,11 +130,11 @@ with gr.Blocks(css=custom_css) as demo:
|
|
130 |
start_button = gr.Button("Attack prepare!",size='lg')
|
131 |
text_input = gr.Textbox(label="Input Prompt")
|
132 |
|
133 |
-
orig_img = gr.Image(label="Image
|
134 |
with gr.Column():
|
135 |
attack_button = gr.Button("UnlearnDiffAtk!",size='lg')
|
136 |
-
text_ouput = gr.Textbox(label="
|
137 |
-
result_img = gr.Image(label="Image Gnerated by
|
138 |
|
139 |
start_button.click(fn=execute_prepare, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_input, orig_img], api_name="prepare")
|
140 |
attack_button.click(fn=execute_udiff, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_ouput, result_img], api_name="udiff")
|
|
|
11 |
|
12 |
# myip = os.environ["0.0.0.0"]
|
13 |
# myport = os.environ["80"]
|
14 |
+
myip = "146.152.224.103"
|
15 |
+
myport=8080
|
16 |
|
17 |
is_spaces = True if "SPACE_ID" in os.environ else False
|
18 |
|
|
|
110 |
label="Unlearning undesirable concepts")
|
111 |
with gr.Column():
|
112 |
# gr.Markdown("Please upload your model id.")
|
113 |
+
drop_model = gr.Dropdown(["ESD", "FMN"],
|
114 |
label="Unlearned DMs")
|
115 |
# diffusion_model_T = gr.Textbox(label='diffusion_model_id')
|
116 |
# concept = gr.Textbox(label='concept')
|
|
|
130 |
start_button = gr.Button("Attack prepare!",size='lg')
|
131 |
text_input = gr.Textbox(label="Input Prompt")
|
132 |
|
133 |
+
orig_img = gr.Image(label="Image Generated by Input Prompt",width=512,show_share_button=False,show_download_button=False)
|
134 |
with gr.Column():
|
135 |
attack_button = gr.Button("UnlearnDiffAtk!",size='lg')
|
136 |
+
text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
|
137 |
+
result_img = gr.Image(label="Image Gnerated by Prompt of UnlearnDiffAtk",width=512,show_share_button=False,show_download_button=False)
|
138 |
|
139 |
start_button.click(fn=execute_prepare, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_input, orig_img], api_name="prepare")
|
140 |
attack_button.click(fn=execute_udiff, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_ouput, result_img], api_name="udiff")
|