"...text-generation-inference.git" did not exist on "ed2a3f617e6116c1fe8ea79aead4fd89b8140a6f"
Unverified Commit 09ac74db authored by David Pollack's avatar David Pollack Committed by GitHub
Browse files

Merge pull request #37 from PgLoLo/master

Download of dataset requires to hold archive in memory
parents 5787787e 0fe0305a
......@@ -181,9 +181,7 @@ class VCTK(data.Dataset):
filename = url.rpartition('/')[2]
file_path = os.path.join(self.root, self.raw_folder, filename)
if not os.path.isfile(file_path):
data = urllib.request.urlopen(url)
with open(file_path, 'wb') as f:
f.write(data.read())
urllib.request.urlretrieve(url, file_path)
if not os.path.exists(dset_abs_path):
with tarfile.open(file_path) as zip_f:
zip_f.extractall(raw_abs_dir)
......
......@@ -101,9 +101,7 @@ class YESNO(data.Dataset):
filename = url.rpartition('/')[2]
file_path = os.path.join(self.root, self.raw_folder, filename)
if not os.path.isfile(file_path):
data = urllib.request.urlopen(url)
with open(file_path, 'wb') as f:
f.write(data.read())
urllib.request.urlretrieve(url, file_path)
else:
print("Tar file already downloaded")
if not os.path.exists(dset_abs_path):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment