TypeError due to load_dataset

Hello All,

I have the following line:

dataset = load_dataset(dataset_path, split="train", streaming=False)

dataset_path is a Path object with the value of PosixPath(‘/home/roland/Documents/hun_tale_gen/hun_tale_gen/data/dataset’)

The referenced dataset_path is created by an earlier save_to_disk method call and the folder structure looks like this:

dataset
–test
----data-00000-of-00001.arrow
----dataset_info.json
----state.json
–train
----data-00000-of-00001.arrow
----dataset_info.json
----state.json
–dataset_dict.json

I got a TypeError exception from the load.py file. Path.replace() takes2 positional arguments but 3 were given. This comes from the 1402nd raw of load.py:

filename = list(filter(lambda x: x, path.replace(os.sep, "/").split("/")))[-1]

I have no idea what is wrong here because it is clear that the method caLL above has only two parameters

pathlib’s Path is currently not supported in load_dataset, so replacing dataset_path with str(dataset_path) should fix the issue.

Thanks @mariosasko it is working now