diff --git a/tzrec/features/feature.py b/tzrec/features/feature.py index c0f84ac..fab17f9 100644 --- a/tzrec/features/feature.py +++ b/tzrec/features/feature.py @@ -401,7 +401,12 @@ def dense_embedding_config( ) -> Optional[DenseEmbeddingConfig]: """Get DenseEmbeddingConfig of the feature.""" if not self.is_sparse: - if self.config.HasField("autodis") and self.config.HasField("mlp"): + if ( + hasattr(self.config, "autodis") + and self.config.HasField("autodis") + and hasattr(self.config, "mlp") + and self.config.HasField("mlp") + ): raise ValueError( f"feature [{self.name}] can not be configured in\ both autodis and mlp embedding."