From 1831916b7fba79fb86ccdfce9abe5ef1fe53c7fb Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Wed, 20 Sep 2023 14:46:06 -0700 Subject: [PATCH] Fix pyright warnings/errors This patch fixes a pyright string concatenation warning and also adds typing information where necessary. --- llmfoundry/data/finetuning/tasks.py | 2 +- tests/test_dataloader.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llmfoundry/data/finetuning/tasks.py b/llmfoundry/data/finetuning/tasks.py index 9b0939e73a..0df52c6f51 100644 --- a/llmfoundry/data/finetuning/tasks.py +++ b/llmfoundry/data/finetuning/tasks.py @@ -206,7 +206,7 @@ def __getitem__(self, idx: int) -> Dict[str, Any]: return _read_binary_tokenized_sample(sample) else: raise RuntimeError( - 'FineTurningDataset needs samples to have prompt/response columns ' + 'FineTurningDataset needs samples to have prompt/response columns ' +\ 'or tokens/labels columns') diff --git a/tests/test_dataloader.py b/tests/test_dataloader.py index 0e6066440f..0fb0870f97 100644 --- a/tests/test_dataloader.py +++ b/tests/test_dataloader.py @@ -63,7 +63,7 @@ def build_mock_ft_streaming_dataset(data_path: str, split: str): output_writer.write(sample) -def build_mock_tokenized_ft_streaming_dataset(data_path, split): +def build_mock_tokenized_ft_streaming_dataset(data_path: str, split: str): columns = {'tokens': 'bytes', 'labels': 'bytes'} dataset = [{