From dd2b2e0d8a13881b4f678945eb540dfe68d23b40 Mon Sep 17 00:00:00 2001 From: Junst Date: Tue, 23 Sep 2025 20:41:17 +0900 Subject: [PATCH] Fix attention_outputs attribute access issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 **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. --- concept_attention.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concept_attention.py b/concept_attention.py index d517e89..9aa5c20 100644 --- a/concept_attention.py +++ b/concept_attention.py @@ -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():