Spaces:
Sleeping
Sleeping
nirmalendu
commited on
Commit
·
e2e40c6
1
Parent(s):
05c1aa1
no head selected fix
Browse files
app.py
CHANGED
|
@@ -59,8 +59,7 @@ def run_unicorn_ablation(selected_layer, selected_heads):
|
|
| 59 |
# layer = selected_layer.split('blocks.')[1].split('.attentions')[0]
|
| 60 |
if selected_heads is None or len(selected_heads) ==0:
|
| 61 |
selected_heads = []
|
| 62 |
-
|
| 63 |
-
return UNICORN_WITH_HORN_PATH, UNICORN_NO_HORN_PATH
|
| 64 |
if len(selected_heads) > 3:
|
| 65 |
selected_heads = selected_heads[:3]
|
| 66 |
selected_heads.sort()
|
|
@@ -75,7 +74,7 @@ def run_unicorn_ablation(selected_layer, selected_heads):
|
|
| 75 |
UNICORN_NO_HORN_PATH = path
|
| 76 |
print(f"Unicorn no horn path was {UNICORN_NO_HORN_PATH}")
|
| 77 |
# In a real experiment you'd use `selected_heads` to ablate SDXL heads.
|
| 78 |
-
return
|
| 79 |
|
| 80 |
|
| 81 |
with gr.Blocks() as demo:
|
|
|
|
| 59 |
# layer = selected_layer.split('blocks.')[1].split('.attentions')[0]
|
| 60 |
if selected_heads is None or len(selected_heads) ==0:
|
| 61 |
selected_heads = []
|
| 62 |
+
return UNICORN_WITH_HORN_PATH
|
|
|
|
| 63 |
if len(selected_heads) > 3:
|
| 64 |
selected_heads = selected_heads[:3]
|
| 65 |
selected_heads.sort()
|
|
|
|
| 74 |
UNICORN_NO_HORN_PATH = path
|
| 75 |
print(f"Unicorn no horn path was {UNICORN_NO_HORN_PATH}")
|
| 76 |
# In a real experiment you'd use `selected_heads` to ablate SDXL heads.
|
| 77 |
+
return UNICORN_NO_HORN_PATH
|
| 78 |
|
| 79 |
|
| 80 |
with gr.Blocks() as demo:
|