Skip to content

Commit

Permalink
Fix circular import due to DISTILABEL_METADATA_KEY (#675)
Browse files Browse the repository at this point in the history
* Fix circular import due to DISTILABEL_METADATA_KEY

* Update src/distilabel/distiset.py

Co-authored-by: Alvaro Bartolome <[email protected]>

---------

Co-authored-by: Alvaro Bartolome <[email protected]>
  • Loading branch information
plaguss and alvarobartt authored May 28, 2024
1 parent 6eddaf8 commit c9623fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/distilabel/distiset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions src/distilabel/steps/constants.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit c9623fc

Please sign in to comment.