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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user