From 6f21df9800688d1bc33b839563ecf0f62695627a Mon Sep 17 00:00:00 2001 From: botbikamordehai2-sketch Date: Sat, 8 Aug 2026 09:43:54 +0000 Subject: [PATCH] fix: handle None config and robust hparams in MambAttention (closes #449) --- deeptab/architectures/mambattention.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deeptab/architectures/mambattention.py b/deeptab/architectures/mambattention.py index a4c75428..813a4a7d 100644 --- a/deeptab/architectures/mambattention.py +++ b/deeptab/architectures/mambattention.py @@ -64,14 +64,15 @@ def __init__( self.returns_ensemble = False + config = config if config is not None else MambAttentionConfig() try: self.pooling_method = self.hparams.pooling_method - except AttributeError: + except (AttributeError, KeyError): self.pooling_method = config.pooling_method try: self.shuffle_embeddings = self.hparams.shuffle_embeddings - except AttributeError: + except (AttributeError, KeyError): self.shuffle_embeddings = config.shuffle_embeddings self.mamba = MambAttn(config)