Datasets:

Muennighoff commited on
Commit
842eb26
1 Parent(s): c825292

Update tatoeba_mt.py

Browse files
Files changed (1) hide show
  1. tatoeba_mt.py +11 -13
tatoeba_mt.py CHANGED
@@ -111,21 +111,19 @@ class tatoebaMT(datasets.GeneratorBasedBuilder):
111
  # release = self.config.release
112
 
113
  files = {}
114
-
115
  test_path = os.path.join("test", f"tatoeba-test.{lang_pair}.tsv")
116
- print("DIR", os.listdir("./"))
117
- print("PATH", test_path)
118
- if os.path.exists(test_path):
119
- files["test"] = test_path
120
-
121
  valid_path = os.path.join("test", f"tatoeba-dev.{lang_pair}.tsv")
122
- if os.path.exists(valid_path):
123
- files["validation"] = valid_path
124
-
125
- data_dir = dl_manager.download_and_extract(files)
126
-
 
 
127
  output = []
128
- if os.path.exists(test_path):
129
  test = datasets.SplitGenerator(
130
  name=datasets.Split.TEST,
131
  gen_kwargs={
@@ -134,7 +132,7 @@ class tatoebaMT(datasets.GeneratorBasedBuilder):
134
  )
135
  output.append(test)
136
 
137
- if os.path.exists(valid_path):
138
  valid = datasets.SplitGenerator(
139
  name=datasets.Split.VALIDATION,
140
  gen_kwargs={
 
111
  # release = self.config.release
112
 
113
  files = {}
114
+
115
  test_path = os.path.join("test", f"tatoeba-test.{lang_pair}.tsv")
116
+ files["test"] = test_path
 
 
 
 
117
  valid_path = os.path.join("test", f"tatoeba-dev.{lang_pair}.tsv")
118
+ files["validation"] = valid_path
119
+ try:
120
+ data_dir = dl_manager.download_and_extract(files)
121
+ except:
122
+ files.pop("validation")
123
+ data_dir = dl_manager.download_and_extract(files)
124
+
125
  output = []
126
+ if "test" in files:
127
  test = datasets.SplitGenerator(
128
  name=datasets.Split.TEST,
129
  gen_kwargs={
 
132
  )
133
  output.append(test)
134
 
135
+ if "validation" in files:
136
  valid = datasets.SplitGenerator(
137
  name=datasets.Split.VALIDATION,
138
  gen_kwargs={