Update app.py
Browse files
app.py
CHANGED
@@ -146,7 +146,8 @@ def run_interpretation(raw_original_prompt, raw_interpretation_prompt, max_new_t
|
|
146 |
-len(bags_of_words[i+1] & bags_of_words[i]) / np.sqrt(len(bags_of_words[i+1]) * len(bags_of_words[i]))
|
147 |
for i in range(len(bags_of_words)-1)
|
148 |
])
|
149 |
-
diff_score = diff_score1 / diff_score1.
|
|
|
150 |
avoid_first, avoid_last = 2, 1 # layers that are usually never important
|
151 |
assert avoid_first >= 1 # due to .diff() we will not be able to compute a score for the first layer
|
152 |
diff_score = diff_score[avoid_first-1:len(diff_score)-avoid_last]
|
|
|
146 |
-len(bags_of_words[i+1] & bags_of_words[i]) / np.sqrt(len(bags_of_words[i+1]) * len(bags_of_words[i]))
|
147 |
for i in range(len(bags_of_words)-1)
|
148 |
])
|
149 |
+
diff_score = diff_score1 / diff_score1.max().values + diff_score2 / diff_score2.max().values
|
150 |
+
|
151 |
avoid_first, avoid_last = 2, 1 # layers that are usually never important
|
152 |
assert avoid_first >= 1 # due to .diff() we will not be able to compute a score for the first layer
|
153 |
diff_score = diff_score[avoid_first-1:len(diff_score)-avoid_last]
|