From c9623fcbfacb396e92005983bf52b7f0acc45514 Mon Sep 17 00:00:00 2001 From: Agus Date: Tue, 28 May 2024 12:26:43 +0200 Subject: [PATCH] Fix circular import due to DISTILABEL_METADATA_KEY (#675) * Fix circular import due to DISTILABEL_METADATA_KEY * Update src/distilabel/distiset.py Co-authored-by: Alvaro Bartolome --------- Co-authored-by: Alvaro Bartolome --- src/distilabel/distiset.py | 3 ++- src/distilabel/steps/constants.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/distilabel/steps/constants.py diff --git a/src/distilabel/distiset.py b/src/distilabel/distiset.py index b9bd1b0e03..cdcdc66604 100644 --- a/src/distilabel/distiset.py +++ b/src/distilabel/distiset.py @@ -21,7 +21,6 @@ from huggingface_hub import DatasetCardData, HfApi from pyarrow.lib import ArrowInvalid -from distilabel.steps.tasks.base import DISTILABEL_METADATA_KEY from distilabel.utils.card.dataset_card import ( DistilabelDatasetCard, size_categories_parser, @@ -224,6 +223,8 @@ def create_distiset( # noqa: C901 The dataset created from the buffer folder, where the different leaf steps will correspond to different configurations of the dataset. """ + from distilabel.steps.constants import DISTILABEL_METADATA_KEY + logger = logging.getLogger("distilabel.distiset") data_dir = Path(data_dir) diff --git a/src/distilabel/steps/constants.py b/src/distilabel/steps/constants.py new file mode 100644 index 0000000000..8d50ae4774 --- /dev/null +++ b/src/distilabel/steps/constants.py @@ -0,0 +1,15 @@ +# Copyright 2023-present, Argilla, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DISTILABEL_METADATA_KEY = "distilabel_metadata"