Skip to content

Commit

Permalink
fix: dataset and tests
Browse files Browse the repository at this point in the history
Added dataset saving fix and test on this
  • Loading branch information
StochasticRomanAgeev committed May 11, 2023
1 parent ab787fa commit e5a5b6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/xturing/datasets/instruction_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(
else:
path = Path(path)
assert Path(path).exists(), "path does not exist"

if path.is_dir():
self.data = load_from_disk(str(path))
elif path.suffix == ".jsonl":
Expand Down Expand Up @@ -123,7 +122,7 @@ def __getitem__(self, idx):
return self.data["train"][idx]

def save(self, path):
return self.data.save_to_disk(path)
return self.data["train"].save_to_disk(path)

@classmethod
def generate_dataset(
Expand Down
1 change: 1 addition & 0 deletions tests/xturing/datasets/test_instruction_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ def test_features_dataset():
"target": "second text",
"instruction": "second instruction",
}
dataset.save(".")

0 comments on commit e5a5b6d

Please sign in to comment.