Spaces:
Running
on
Zero
Running
on
Zero
qinghuazhou
commited on
Commit
·
e50aab0
1
Parent(s):
f0ac79f
rearranged app structure
Browse files
app.py
CHANGED
@@ -145,17 +145,8 @@ with gr.Blocks(theme=gr.themes.Soft(text_size="sm")) as demo:
|
|
145 |
# Stealth edits to large language models
|
146 |
|
147 |
Here in this demo, you will be able to test out stealth edits and attacks from the paper [***"Stealth edits to large language models"***](https://arxiv.org/abs/2406.12670) on the `llama-3-8b` model. For more detailed experiments, please refer to our [paper](https://arxiv.org/abs/2406.12670) and our [source code](https://github.com/qinghua-zhou/stealth-edits).
|
148 |
-
|
149 |
-
<br>
|
150 |
-
|
151 |
-
### Load Examples
|
152 |
-
|
153 |
-
You can choose to load existing examples by clicking on the below buttons OR try out your own examples by following the instructions to insert texts in each section.
|
154 |
"""
|
155 |
)
|
156 |
-
with gr.Row():
|
157 |
-
load_examples0_button = gr.Button("Load Examples (Set 1)")
|
158 |
-
load_examples1_button = gr.Button("Load Examples (Set 2)")
|
159 |
|
160 |
gr.Image("figures/siam2e.png", width=600)
|
161 |
|
@@ -395,6 +386,21 @@ with gr.Blocks(theme=gr.themes.Soft(text_size="sm")) as demo:
|
|
395 |
try_reveal_button.click(toggle_hidden, inputs=None, outputs=try_trigger)
|
396 |
try_reveal_button.click(toggle_hidden, inputs=None, outputs=hidden_attacked)
|
397 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
# load examples
|
399 |
load_examples0_button.click(insert_examples0, outputs=[prompt, truth, atk_prompt, atk_target, test_prompt, try_prompt, try_aug_prompt])
|
400 |
load_examples1_button.click(insert_examples1, outputs=[prompt, truth, atk_prompt, atk_target, test_prompt, try_prompt, try_aug_prompt])
|
|
|
145 |
# Stealth edits to large language models
|
146 |
|
147 |
Here in this demo, you will be able to test out stealth edits and attacks from the paper [***"Stealth edits to large language models"***](https://arxiv.org/abs/2406.12670) on the `llama-3-8b` model. For more detailed experiments, please refer to our [paper](https://arxiv.org/abs/2406.12670) and our [source code](https://github.com/qinghua-zhou/stealth-edits).
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
"""
|
149 |
)
|
|
|
|
|
|
|
150 |
|
151 |
gr.Image("figures/siam2e.png", width=600)
|
152 |
|
|
|
386 |
try_reveal_button.click(toggle_hidden, inputs=None, outputs=try_trigger)
|
387 |
try_reveal_button.click(toggle_hidden, inputs=None, outputs=hidden_attacked)
|
388 |
|
389 |
+
|
390 |
+
gr.Markdown(
|
391 |
+
|
392 |
+
"""
|
393 |
+
<br>
|
394 |
+
|
395 |
+
### Load Examples
|
396 |
+
|
397 |
+
You can choose to load existing examples by clicking on the below buttons OR try out your own examples by following the instructions to insert texts in each section.
|
398 |
+
"""
|
399 |
+
)
|
400 |
+
with gr.Row():
|
401 |
+
load_examples0_button = gr.Button("Load examples (set 1)")
|
402 |
+
load_examples1_button = gr.Button("Load examples (set 2)")
|
403 |
+
|
404 |
# load examples
|
405 |
load_examples0_button.click(insert_examples0, outputs=[prompt, truth, atk_prompt, atk_target, test_prompt, try_prompt, try_aug_prompt])
|
406 |
load_examples1_button.click(insert_examples1, outputs=[prompt, truth, atk_prompt, atk_target, test_prompt, try_prompt, try_aug_prompt])
|