Youssef Benhachem commited on
Commit
e0ec0a7
1 Parent(s): adf7fe8
Files changed (1) hide show
  1. KHATT.py +5 -9
KHATT.py CHANGED
@@ -49,13 +49,6 @@ _DATA_URL = {
49
  ],
50
  }
51
 
52
- l = os.listdir()
53
-
54
- print(l)
55
-
56
- n = list(filter(lambda l:l.endswith('xlsx'), l))
57
-
58
- texts = pd.read_excel(n[0])
59
 
60
  class KHATT(datasets.GeneratorBasedBuilder):
61
  VERSION = datasets.Version("1.0.0")
@@ -101,10 +94,13 @@ class KHATT(datasets.GeneratorBasedBuilder):
101
  ),
102
  ]
103
 
104
- def _generate_examples(self, archives, split):
105
  """Yields examples."""
106
  idx = 0
107
- for archive in archives:
 
 
 
108
  for path, file in archive:
109
  if path.endswith(".TIF"):
110
  if split != "test":
 
49
  ],
50
  }
51
 
 
 
 
 
 
 
 
52
 
53
  class KHATT(datasets.GeneratorBasedBuilder):
54
  VERSION = datasets.Version("1.0.0")
 
94
  ),
95
  ]
96
 
97
+ def _generate_examples(self, archives, split, dl_manager):
98
  """Yields examples."""
99
  idx = 0
100
+ path_labels, _ = dl_manager.dowbload('https://huggingface.co/datasets/benhachem/KHATT/resolve/main/Images_text_excel.xlsx')
101
+ texts = pd.read_excel(path_labels)
102
+
103
+ for archive in archives[:-1]:
104
  for path, file in archive:
105
  if path.endswith(".TIF"):
106
  if split != "test":