fixed bug in split generator
Browse files
sroie.py
CHANGED
@@ -82,13 +82,7 @@ class Sroie(datasets.GeneratorBasedBuilder):
|
|
82 |
downloaded_file = dl_manager.download_and_extract(_URLS)
|
83 |
# move files from the second URL together with files from the first one.
|
84 |
dest = Path(downloaded_file[0])/"CORD"
|
85 |
-
|
86 |
-
for file_type in ["image", "tagged"]:
|
87 |
-
# if split == "test" and file_type == "json":
|
88 |
-
# continue
|
89 |
-
files = (Path(downloaded_file[1])/"sroie"/split/file_type).iterdir()
|
90 |
-
for f in files:
|
91 |
-
os.rename(f, dest/split/file_type/f.name)
|
92 |
return [
|
93 |
datasets.SplitGenerator(
|
94 |
name=datasets.Split.TRAIN, gen_kwargs={"filepath": dest/"train"}
|
|
|
82 |
downloaded_file = dl_manager.download_and_extract(_URLS)
|
83 |
# move files from the second URL together with files from the first one.
|
84 |
dest = Path(downloaded_file[0])/"CORD"
|
85 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
return [
|
87 |
datasets.SplitGenerator(
|
88 |
name=datasets.Split.TRAIN, gen_kwargs={"filepath": dest/"train"}
|