DiGyt commited on
Commit
5d53ed5
1 Parent(s): cf205f8

Don't force download

Browse files
Files changed (1) hide show
  1. ecoset.py +4 -3
ecoset.py CHANGED
@@ -144,11 +144,12 @@ class Ecoset(datasets.GeneratorBasedBuilder):
144
  if not op.exists(target_dir):
145
  os.makedirs(target_dir)
146
  zip_path = op.join(target_dir, "ecoset.zip")
147
- s3 = boto3.client(urlinfo.scheme, config=Config(signature_version=UNSIGNED))
148
- s3.download_file(urlinfo.netloc, urlinfo.path[1:], zip_path)
 
149
  # unzip
150
  # Expand-Archive -LiteralPath <PathToZipFile> -DestinationPath <PathToDestination>
151
- subprocess.call(["unzip", "-P", password.encode("ascii"), "-o", zip_path, "-d", target_dir], shell=False)
152
 
153
 
154
  # take slow or very slow download depending on platform
 
144
  if not op.exists(target_dir):
145
  os.makedirs(target_dir)
146
  zip_path = op.join(target_dir, "ecoset.zip")
147
+ if not op.exists(zip_path):
148
+ s3 = boto3.client(urlinfo.scheme, config=Config(signature_version=UNSIGNED))
149
+ s3.download_file(urlinfo.netloc, urlinfo.path[1:], zip_path)
150
  # unzip
151
  # Expand-Archive -LiteralPath <PathToZipFile> -DestinationPath <PathToDestination>
152
+ subprocess.call(["unzip", "-n", "-P", password.encode("ascii"), "-o", zip_path, "-d", target_dir], shell=False)
153
 
154
 
155
  # take slow or very slow download depending on platform