From e2b04255cfff7c98fbf4f94a6df9cf98e0943199 Mon Sep 17 00:00:00 2001 From: caterinaLacerra Date: Thu, 24 Mar 2022 19:37:45 +0100 Subject: [PATCH] minor fix in open_fn for gzip files --- swords/datasets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swords/datasets.py b/swords/datasets.py index d7d6f8f..75298d3 100644 --- a/swords/datasets.py +++ b/swords/datasets.py @@ -1501,9 +1501,9 @@ def _print(x): # Load from disk _print('Loading from {dataset}') if dataset.endswith('.gz'): - open_fn = open - else: open_fn = gzip.open + else: + open_fn = open with open_fn(dataset, 'r') as f: d = LexSubDataset.from_dict(json.load(f)) else: