From 1dbc68d4aecc958f2db37d0cb6cdd7425766149c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BB=D0=B0=D1=85=D0=BE=D0=B2=20=D0=90=D0=BB?= =?UTF-8?q?=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=9F=D0=B0=D0=B2=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Thu, 12 Sep 2024 13:22:38 +0000 Subject: [PATCH] refactoring --- turbo_alignment/common/logging/__init__.py | 1 + .../{pipelines/mixin => common/logging}/logging.py | 0 turbo_alignment/pipelines/mixin/__init__.py | 1 - turbo_alignment/pipelines/train/base.py | 3 ++- turbo_alignment/settings/logging/clearml.py | 4 ++-- turbo_alignment/settings/logging/weights_and_biases.py | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) rename turbo_alignment/{pipelines/mixin => common/logging}/logging.py (100%) diff --git a/turbo_alignment/common/logging/__init__.py b/turbo_alignment/common/logging/__init__.py index 5624acb..dd97883 100755 --- a/turbo_alignment/common/logging/__init__.py +++ b/turbo_alignment/common/logging/__init__.py @@ -1 +1,2 @@ from .logger import get_project_logger +from .logging import LoggingRegistry diff --git a/turbo_alignment/pipelines/mixin/logging.py b/turbo_alignment/common/logging/logging.py similarity index 100% rename from turbo_alignment/pipelines/mixin/logging.py rename to turbo_alignment/common/logging/logging.py diff --git a/turbo_alignment/pipelines/mixin/__init__.py b/turbo_alignment/pipelines/mixin/__init__.py index bf25cc6..55116b8 100755 --- a/turbo_alignment/pipelines/mixin/__init__.py +++ b/turbo_alignment/pipelines/mixin/__init__.py @@ -1,2 +1 @@ -from .logging import LoggingRegistry from .s3 import S3Mixin diff --git a/turbo_alignment/pipelines/train/base.py b/turbo_alignment/pipelines/train/base.py index 3f1f1be..bbe68a3 100755 --- a/turbo_alignment/pipelines/train/base.py +++ b/turbo_alignment/pipelines/train/base.py @@ -15,12 +15,13 @@ from turbo_alignment.cherry_picks.base import CherryPickCallbackBase from turbo_alignment.common.data.io import write_json from turbo_alignment.common.logging import get_project_logger +from turbo_alignment.common.logging.logging import LoggingRegistry from turbo_alignment.common.tf.loaders.model import load_model from turbo_alignment.common.tf.loaders.tokenizer import load_tokenizer from turbo_alignment.common.tf.special_tokens_setter import SpecialTokensSetter from turbo_alignment.dataset.loader import DatasetLoader from turbo_alignment.pipelines.base import BaseStrategy -from turbo_alignment.pipelines.mixin import LoggingRegistry, S3Mixin +from turbo_alignment.pipelines.mixin import S3Mixin from turbo_alignment.settings.datasets.base import DatasetStrategy from turbo_alignment.settings.pipelines.train.base import BaseTrainExperimentSettings from turbo_alignment.settings.s3 import ExperimentMetadata, S3HandlerParameters diff --git a/turbo_alignment/settings/logging/clearml.py b/turbo_alignment/settings/logging/clearml.py index 2f2ffc7..b42f963 100644 --- a/turbo_alignment/settings/logging/clearml.py +++ b/turbo_alignment/settings/logging/clearml.py @@ -1,7 +1,7 @@ -from turbo_alignment.settings.base import ExtraFieldsNotAllowedBaseModel +from pydantic_settings import BaseSettings -class ClearMLSettings(ExtraFieldsNotAllowedBaseModel): +class ClearMLSettings(BaseSettings): project_name: str task_name: str tags: list[str] = [] diff --git a/turbo_alignment/settings/logging/weights_and_biases.py b/turbo_alignment/settings/logging/weights_and_biases.py index 94821dc..fb24801 100755 --- a/turbo_alignment/settings/logging/weights_and_biases.py +++ b/turbo_alignment/settings/logging/weights_and_biases.py @@ -1,6 +1,6 @@ from enum import Enum -from turbo_alignment.settings.base import ExtraFieldsNotAllowedBaseModel +from pydantic_settings import BaseSettings class WandbMode(str, Enum): @@ -9,7 +9,7 @@ class WandbMode(str, Enum): DISABLED: str = 'disabled' -class WandbSettings(ExtraFieldsNotAllowedBaseModel): +class WandbSettings(BaseSettings): project_name: str run_name: str entity: str