Kaixuanliu commited on
Commit
3f44b7d
1 Parent(s): b23eb33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -96,6 +96,8 @@ with gr.Blocks(css=custom_css) as demo:
96
  # attacker = gr.Textbox(label='attacker')
97
 
98
  # start_button = gr.Button("Attack!")
 
 
99
 
100
  with gr.Column():
101
  shown_columns_step = gr.Slider(
@@ -108,14 +110,13 @@ with gr.Blocks(css=custom_css) as demo:
108
 
109
  orig_img = gr.Image(label="Image Generated by Input Prompt",width=260,show_share_button=False,show_download_button=False)
110
  with gr.Column():
111
- atk_idx = gr.Textbox(label="attack index")
112
  start_button = gr.Button("UnlearnDiffAtk!",size='lg')
113
  with gr.Column(min_width=260):
114
  text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
115
  result_img = gr.Image(label="Image Gnerated by Prompt of UnlearnDiffAtk",width=260,show_share_button=False,show_download_button=False)
116
 
117
 
118
- start_button.click(fn=excute_udiff, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_input, text_ouput, orig_img, result_img], api_name="udiff")
119
 
120
 
121
  demo.queue().launch(server_name='0.0.0.0')
 
96
  # attacker = gr.Textbox(label='attacker')
97
 
98
  # start_button = gr.Button("Attack!")
99
+ with gr.Column():
100
+ atk_idx = gr.Textbox(label="attack index")
101
 
102
  with gr.Column():
103
  shown_columns_step = gr.Slider(
 
110
 
111
  orig_img = gr.Image(label="Image Generated by Input Prompt",width=260,show_share_button=False,show_download_button=False)
112
  with gr.Column():
 
113
  start_button = gr.Button("UnlearnDiffAtk!",size='lg')
114
  with gr.Column(min_width=260):
115
  text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
116
  result_img = gr.Image(label="Image Gnerated by Prompt of UnlearnDiffAtk",width=260,show_share_button=False,show_download_button=False)
117
 
118
 
119
+ start_button.click(fn=excute_udiff, inputs=[drop_model, drop, shown_columns_step, int(atk_idx)], outputs=[text_input, text_ouput, orig_img, result_img], api_name="udiff")
120
 
121
 
122
  demo.queue().launch(server_name='0.0.0.0')