taka-yamakoshi
commited on
Commit
•
a4dd7f0
1
Parent(s):
842f713
debug
Browse files
app.py
CHANGED
@@ -245,11 +245,11 @@ if __name__=='__main__':
|
|
245 |
option_1_tokens = option_1_tokens_1
|
246 |
option_2_tokens = option_2_tokens_1
|
247 |
|
|
|
248 |
interventions = [{'lay':[],'qry':[],'key':[],'val':[]} for i in range(num_layers)]
|
249 |
probs_original = run(interventions,1,model,masked_ids_option_1,masked_ids_option_2,option_1_tokens,option_2_tokens,pron_locs)
|
250 |
st.write(probs_original)
|
251 |
|
252 |
-
if st.session_state['page_status'] == 'finish_debug':
|
253 |
for layer_id in range(num_layers):
|
254 |
interventions = [create_interventions(16,['lay','qry','key','val'],num_heads) if i==layer_id else {'lay':[],'qry':[],'key':[],'val':[]} for i in range(num_layers)]
|
255 |
probs = run(interventions,num_heads,model,masked_ids_option_1,masked_ids_option_2,option_1_tokens,option_2_tokens,pron_locs)
|
|
|
245 |
option_1_tokens = option_1_tokens_1
|
246 |
option_2_tokens = option_2_tokens_1
|
247 |
|
248 |
+
if st.session_state['page_status'] == 'finish_debug':
|
249 |
interventions = [{'lay':[],'qry':[],'key':[],'val':[]} for i in range(num_layers)]
|
250 |
probs_original = run(interventions,1,model,masked_ids_option_1,masked_ids_option_2,option_1_tokens,option_2_tokens,pron_locs)
|
251 |
st.write(probs_original)
|
252 |
|
|
|
253 |
for layer_id in range(num_layers):
|
254 |
interventions = [create_interventions(16,['lay','qry','key','val'],num_heads) if i==layer_id else {'lay':[],'qry':[],'key':[],'val':[]} for i in range(num_layers)]
|
255 |
probs = run(interventions,num_heads,model,masked_ids_option_1,masked_ids_option_2,option_1_tokens,option_2_tokens,pron_locs)
|