Spaces:
Running
Running
added the None type check
Browse files
app.py
CHANGED
@@ -85,7 +85,8 @@ def show_final_layer_attention_maps(
|
|
85 |
# Forward pass through the model
|
86 |
outputs = model(**tensor, output_attentions=True)
|
87 |
|
88 |
-
|
|
|
89 |
print("Attention outputs are None.")
|
90 |
return None
|
91 |
|
|
|
85 |
# Forward pass through the model
|
86 |
outputs = model(**tensor, output_attentions=True)
|
87 |
|
88 |
+
print(type(outputs.attentions[0]))
|
89 |
+
if outputs.attentions[0] is None:
|
90 |
print("Attention outputs are None.")
|
91 |
return None
|
92 |
|