xinchen9 commited on
Commit
e8f35b2
1 Parent(s): fb3682d

[Update]Add slider

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -74,15 +74,18 @@ with gr.Blocks(css=custom_css) as demo:
74
 
75
  # start_button = gr.Button("Attack!")
76
 
77
- # with gr.Column():
78
- # result = gr.Textbox(label="unsafe prompt")
 
 
 
79
 
80
- with gr.Column():
81
- gr.Examples(examples=[
82
- ["CompVis/stable-diffusion-v1-4", "nudity", "text_grad"]
83
- ], inputs=[diffusion_model_id, concept, attacker])
84
 
85
- start_button.click(fn=excute_udiff, inputs=[diffusion_model_id, concept, attacker], outputs=result, api_name="udiff")
86
 
87
 
88
  # demo.queue(default_enabled=False, api_open=False, max_size=5).launch(debug=True, show_api=False)
 
74
 
75
  # start_button = gr.Button("Attack!")
76
 
77
+ with gr.Column():
78
+ shown_columns_step = gr.Slider(
79
+ 1, 100, value=40,
80
+ step=1, label="Attack Steps", info="Choose between 1 and 100",
81
+ interactive=True,)
82
 
83
+ # with gr.Column():
84
+ # gr.Examples(examples=[
85
+ # ["CompVis/stable-diffusion-v1-4", "nudity", "text_grad"]
86
+ # ], inputs=[diffusion_model_id, concept, attacker])
87
 
88
+ # start_button.click(fn=excute_udiff, inputs=[diffusion_model_id, concept, attacker], outputs=result, api_name="udiff")
89
 
90
 
91
  # demo.queue(default_enabled=False, api_open=False, max_size=5).launch(debug=True, show_api=False)