Skip to content

Commit 56e206a

Browse files
committed
try to fix pydantic errors
1 parent 5655386 commit 56e206a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

autointent/modules/base/_base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class BaseModule(ABC):
3232
name: str
3333
"""Name of the module."""
3434

35+
@property
36+
def trial_name(self) -> str:
37+
"""Name of the module for logging."""
38+
return self.name
39+
3540
@abstractmethod
3641
def fit(self, *args: tuple[Any], **kwargs: dict[str, Any]) -> None:
3742
"""Fit the model.

autointent/modules/scoring/_sklearn/sklearn_scorer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class SklearnScorer(BaseScorer):
5353
>>> probabilities = scorer.predict(test_utterances)
5454
"""
5555

56+
name = "sklearn"
5657
supports_multilabel = True
5758
supports_multiclass = True
5859

@@ -79,7 +80,7 @@ def __init__(
7980
raise ValueError(msg)
8081

8182
@property
82-
def name(self) -> str:
83+
def trial_name(self) -> str:
8384
return f"sklearn_{self.clf_name}"
8485

8586
@classmethod

autointent/nodes/_node_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def objective(
131131
module = self.node_info.modules_available[module_name].from_context(context, **config)
132132
config.update(module.get_implicit_initialization_params())
133133

134-
context.callback_handler.start_module(module_name=module_name, num=self._counter, module_kwargs=config)
134+
context.callback_handler.start_module(module_name=module.trial_name, num=self._counter, module_kwargs=config)
135135

136136
self._logger.debug("Scoring %s module...", module_name)
137137

0 commit comments

Comments
 (0)