Spaces:
Running
on
Zero
Running
on
Zero
hardcode unrelated features
Browse files
app.py
CHANGED
|
@@ -49,6 +49,10 @@ greedy_file_path = "assets/greedy.jpg"
|
|
| 49 |
railway_file_path = "assets/railway.jpg"
|
| 50 |
happy_file_path = "assets/happy.jpg"
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
@spaces.GPU
|
| 53 |
def generate_activations(image):
|
| 54 |
prompt = "<image>"
|
|
@@ -96,7 +100,7 @@ def generate_activations(image):
|
|
| 96 |
handle.remove()
|
| 97 |
examples = []
|
| 98 |
for indice in topk_indices:
|
| 99 |
-
if indice <= 5000:
|
| 100 |
examples.append([ f"model.layers.24_feature{indice.item()}",explanations[f"model.layers.24_feature{indice.item()}"]])
|
| 101 |
|
| 102 |
|
|
|
|
| 49 |
railway_file_path = "assets/railway.jpg"
|
| 50 |
happy_file_path = "assets/happy.jpg"
|
| 51 |
|
| 52 |
+
unrelated_features = [
|
| 53 |
+
693, 793, 2033, 1195, 4879, 890, 1762, 45, 4258
|
| 54 |
+
]
|
| 55 |
+
|
| 56 |
@spaces.GPU
|
| 57 |
def generate_activations(image):
|
| 58 |
prompt = "<image>"
|
|
|
|
| 100 |
handle.remove()
|
| 101 |
examples = []
|
| 102 |
for indice in topk_indices:
|
| 103 |
+
if indice <= 5000 and indice not in unrelated_features:
|
| 104 |
examples.append([ f"model.layers.24_feature{indice.item()}",explanations[f"model.layers.24_feature{indice.item()}"]])
|
| 105 |
|
| 106 |
|