karolyartur
commited on
Commit
·
dc0e5e7
1
Parent(s):
daae59b
Keep read bytes instead of file objects
Browse files
SMVB.py
CHANGED
@@ -135,6 +135,7 @@ class SMVBDataset(datasets.GeneratorBasedBuilder):
|
|
135 |
|
136 |
for i, info in enumerate(data):
|
137 |
if file_infos and i%len(keys) == 0:
|
138 |
-
yield (i//len(keys))-1, {k:{'path':d[0],'bytes':d[1]
|
139 |
file_infos = []
|
140 |
-
|
|
|
|
135 |
|
136 |
for i, info in enumerate(data):
|
137 |
if file_infos and i%len(keys) == 0:
|
138 |
+
yield (i//len(keys))-1, {k:{'path':d[0],'bytes':d[1]} for k,d in zip(keys,file_infos)}
|
139 |
file_infos = []
|
140 |
+
file_path, file_object = info
|
141 |
+
file_infos.append((file_path, file_object.read()))
|