Skip to content

Commit

Permalink
Add revision runtime parameter to LoadDataFromHub (#928)
Browse files Browse the repository at this point in the history
* Add `revision` runtime parameter

* Lint

* Skip `PairRM` tests
  • Loading branch information
gabrielmbmb authored Aug 26, 2024
1 parent af3515a commit d010f79
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/distilabel/steps/generators/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class LoadDataFromHub(GeneratorStep):
- `split`: The split of the dataset to load. Defaults to 'train'.
- `config`: The configuration of the dataset to load. This is optional and only
needed if the dataset has multiple configurations.
- `revision`: The revision of the dataset to load. Defaults to the latest revision.
- `streaming`: Whether to load the dataset in streaming mode or not. Defaults to
`False`.
- `num_examples`: The number of examples to load from the dataset.
Expand Down Expand Up @@ -122,6 +123,10 @@ class LoadDataFromHub(GeneratorStep):
description="The configuration of the dataset to load. This is optional and only"
" needed if the dataset has multiple configurations.",
)
revision: Optional[RuntimeParameter[str]] = Field(
default=None,
description="The revision of the dataset to load. Defaults to the latest revision.",
)
streaming: RuntimeParameter[bool] = Field(
default=False,
description="Whether to load the dataset in streaming mode or not. Defaults to False.",
Expand Down Expand Up @@ -149,6 +154,7 @@ def load(self) -> None:
self.repo_id, # type: ignore
self.config,
split=self.split,
revision=self.revision,
streaming=self.streaming,
)
num_examples = self._get_dataset_num_examples()
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_multiple_replicas.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import TYPE_CHECKING

import pytest

from distilabel.pipeline import Pipeline
from distilabel.steps import LoadDataFromDicts, StepInput, StepResources, step

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/steps/tasks/test_pair_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
from unittest.mock import MagicMock, patch

import numpy as np
import pytest

from distilabel.pipeline.local import Pipeline
from distilabel.steps.tasks.pair_rm import PairRM


@pytest.mark.skip(reason="Not maintained and to be deprecated.")
@patch("llm_blender.Blender")
class TestPairRM:
def test_process(self, mocker: MagicMock) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/unit/steps/tasks/test_ultrafeedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Any, Dict, List, Union

import pytest

from distilabel.llms.base import LLM
from distilabel.llms.typing import GenerateOutput
from distilabel.steps.tasks.typing import ChatType
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/steps/tasks/test_urial.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import pytest
from distilabel.steps.tasks.urial import URIAL

from distilabel.steps.tasks.urial import URIAL
from tests.unit.conftest import DummyLLM


Expand Down
1 change: 1 addition & 0 deletions tests/unit/steps/test_truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Optional

import pytest

from distilabel.steps.truncate import TruncateTextColumn


Expand Down

0 comments on commit d010f79

Please sign in to comment.