Skip to content

fix: handle None config and robust hparams in MambAttention (closes #449) - #464

Open
botbikamordehai2-sketch wants to merge 1 commit into
OpenTabular:mainfrom
botbikamordehai2-sketch:fix/issue-449-1786182233
Open

fix: handle None config and robust hparams in MambAttention (closes #449)#464
botbikamordehai2-sketch wants to merge 1 commit into
OpenTabular:mainfrom
botbikamordehai2-sketch:fix/issue-449-1786182233

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

This PR fixes a bug where loading a saved MambAttention model could fail or lose configuration state. The issue reports that load() sets model_config, preprocessing_config, trainer_config, and random_state to None, causing the model to silently retrain with library defaults. In MambAttention.__init__, if config is None (as set by restore_base_state), accessing config.pooling_method or config.shuffle_embeddings in the fallback would raise an AttributeError, breaking model reconstruction.

Fix

  • Guarded against config being None by substituting with a default MambAttentionConfig().
  • Extended the exception handling in hparams lookups to catch KeyError as well, making it more robust to missing hyperparameters.
  • This ensures that loaded models retain the correct configuration and can be safely used for prediction, scoring, or further fitting.

Closes #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Save/load loses estimator state, and estimators are not recognised as classifiers/regressors by sklearn

1 participant