jamescalam commited on
Commit
9f356c7
1 Parent(s): 395e0e5

Update unsplash-25k-photos.py

Browse files
Files changed (1) hide show
  1. unsplash-25k-photos.py +6 -0
unsplash-25k-photos.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import datasets
2
 
3
  _CITATION = """\
@@ -65,6 +66,11 @@ class Unsplash(datasets.GeneratorBasedBuilder):
65
 
66
  def _split_generators(self, dl_manager):
67
  new_url = dl_manager.download_and_extract(_URL)
 
 
 
 
 
68
  return [
69
  datasets.SplitGenerator(
70
  name=datasets.Split.TRAIN,
 
1
+ import os
2
  import datasets
3
 
4
  _CITATION = """\
 
66
 
67
  def _split_generators(self, dl_manager):
68
  new_url = dl_manager.download_and_extract(_URL)
69
+ # remove extra files
70
+ for file in os.listdir(new_url):
71
+ if os.path.isfile(new_url+"/"+file):
72
+ if file != 'photos.tsv000':
73
+ os.remove(new_url+'/'+file)
74
  return [
75
  datasets.SplitGenerator(
76
  name=datasets.Split.TRAIN,