Fix attention_outputs attribute access issue

🔧 **Fix Attribute Access Issue**:

1. **Fixed attention_outputs Access**:
   - The extract_attention_outputs() method returns attention_outputs
   - But the return value wasn't being captured
   - Now properly capturing the returned attention_outputs

2. **Proper Method Flow**:
   - extract_attention_outputs() returns attention_outputs
   - _create_concept_maps_from_attention() accesses self.attention_outputs
   - This should resolve the 'ConceptAttentionProcessor' object has no attribute 'attention_outputs' error

This should fix the attribute access issue and allow
attention outputs to be properly captured and processed.
This commit is contained in:
Junst
2025-09-23 20:41:17 +09:00
parent 2ea5df78d5
commit dd2b2e0d8a
+1 -1
View File
@@ -402,7 +402,7 @@ class ConceptAttentionProcessor:
logger.info(f"Extracted embeddings for concepts: {list(concept_embeddings.keys())}")
# Register attention hooks
self.concept_attention.extract_attention_outputs()
attention_outputs = self.concept_attention.extract_attention_outputs()
# Run model forward pass to capture attention
with torch.no_grad():