darentang commited on
Commit
684f1b4
1 Parent(s): 2d99897

fixed bug in split generator

Browse files
Files changed (1) hide show
  1. sroie.py +1 -7
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
- for split in ["train", "test"]:
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"}