ujs commited on
Commit
c229910
·
1 Parent(s): a36b7e5

Fixed issues

Browse files
Files changed (3) hide show
  1. data/test.tar.gz +2 -2
  2. data/train.tar.gz +2 -2
  3. hinglish.py +10 -7
data/test.tar.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:53a66b0b65409454463947e182f9312bfc45ed5fc936f3b526169c40ffa606e3
3
- size 55631613
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b631b2a45d77c64fb706d553fba35b5b7edd4d35368300532b86e4b66d82578
3
+ size 55633425
data/train.tar.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fb47167075de70e11629ccf9dddf0b54d670b9285cd6aae6b9960b767a4566f9
3
- size 959805239
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a208fb7b71e36a49adbabc14c010f7bc14f384330dd39298446e82306f6ffb95
3
+ size 959848246
hinglish.py CHANGED
@@ -44,22 +44,23 @@ class HinglishDataset(datasets.GeneratorBasedBuilder):
44
  def _split_generators(self, dl_manager):
45
  prompts_paths = dl_manager.download(_ANNOT_URL)
46
  archive = dl_manager.download(_DATA_URL)
47
- data_dir = './data'
 
48
  return [
49
  datasets.SplitGenerator(
50
  name=datasets.Split.TRAIN,
51
  gen_kwargs={
52
  "prompts_path": prompts_paths["train"],
53
- "path_to_clips": data_dir,
54
- "audio_files": dl_manager.iter_archive(archive),
55
  },
56
  ),
57
  datasets.SplitGenerator(
58
  name=datasets.Split.TEST,
59
  gen_kwargs={
60
  "prompts_path": prompts_paths["test"],
61
- "path_to_clips": data_dir,
62
- "audio_files": dl_manager.iter_archive(archive),
63
  },
64
  ),
65
  ]
@@ -69,19 +70,21 @@ class HinglishDataset(datasets.GeneratorBasedBuilder):
69
  with open(prompts_path, encoding="utf-8") as f:
70
  for row in f:
71
  data = row.strip().split(",")
72
- audio_path = "/".join([path_to_clips, data[0]])
73
  examples[audio_path] = {
74
  "path": audio_path,
75
  "sentence": data[1]
76
  }
77
  inside_clips_dir = False
78
  id_ = 0
 
79
  for path, f in audio_files:
80
  if path.startswith(path_to_clips):
81
  inside_clips_dir = True
82
  if path in examples:
83
  audio = {"path": path, "bytes": f.read()}
 
84
  yield id_, {**examples[path], "audio": audio}
85
- id += 1
86
  elif inside_clips_dir:
87
  break
 
44
  def _split_generators(self, dl_manager):
45
  prompts_paths = dl_manager.download(_ANNOT_URL)
46
  archive = dl_manager.download(_DATA_URL)
47
+ train_dir = 'train'
48
+ test_dir = 'test'
49
  return [
50
  datasets.SplitGenerator(
51
  name=datasets.Split.TRAIN,
52
  gen_kwargs={
53
  "prompts_path": prompts_paths["train"],
54
+ "path_to_clips": train_dir,
55
+ "audio_files": dl_manager.iter_archive(archive[0]),
56
  },
57
  ),
58
  datasets.SplitGenerator(
59
  name=datasets.Split.TEST,
60
  gen_kwargs={
61
  "prompts_path": prompts_paths["test"],
62
+ "path_to_clips": test_dir,
63
+ "audio_files": dl_manager.iter_archive(archive[1]),
64
  },
65
  ),
66
  ]
 
70
  with open(prompts_path, encoding="utf-8") as f:
71
  for row in f:
72
  data = row.strip().split(",")
73
+ audio_path = "/".join([data[0]])
74
  examples[audio_path] = {
75
  "path": audio_path,
76
  "sentence": data[1]
77
  }
78
  inside_clips_dir = False
79
  id_ = 0
80
+ # print(examples)
81
  for path, f in audio_files:
82
  if path.startswith(path_to_clips):
83
  inside_clips_dir = True
84
  if path in examples:
85
  audio = {"path": path, "bytes": f.read()}
86
+ # print(audio)
87
  yield id_, {**examples[path], "audio": audio}
88
+ id_ += 1
89
  elif inside_clips_dir:
90
  break