Skip to content

Commit 9561cde

Browse files
authored
fix penn dataset (#1552)
1 parent 5056218 commit 9561cde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchtext/datasets/penntreebank.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def PennTreebank(root, split: Union[Tuple[str], str]):
4747
hash_dict={os.path.join(root, os.path.basename(URL[split])): MD5[split]},
4848
hash_type="md5",
4949
)
50-
cache_dp = HttpReader(cache_dp).end_caching(mode="w", same_filepath_fn=True)
50+
cache_dp = HttpReader(cache_dp).end_caching(mode="wb", same_filepath_fn=True)
5151
data_dp = FileOpener(cache_dp, mode="r")
5252
# remove single leading and trailing space from the dataset
5353
return data_dp.readlines(return_path=False).map(lambda t: t.strip())

0 commit comments

Comments
 (0)