KELONMYOSA commited on
Commit
83bcf6c
1 Parent(s): 078cc46
Files changed (1) hide show
  1. dusha.py +6 -5
dusha.py CHANGED
@@ -12,8 +12,8 @@ The corpus contains approximately 350 hours of data. Four basic emotions that us
12
 
13
  _HOMEPAGE = "https://github.com/salute-developers/golos/tree/master/dusha#dusha-dataset"
14
 
15
- DATA_DIR = "data.zip"
16
- METADATA_DIR = "metadata.csv"
17
 
18
 
19
  class Dusha(datasets.GeneratorBasedBuilder):
@@ -34,12 +34,13 @@ class Dusha(datasets.GeneratorBasedBuilder):
34
  )
35
 
36
  def _split_generators(self, dl_manager):
37
- local_extracted_archive = dl_manager.extract([DATA_DIR]) if not dl_manager.is_streaming else None
 
38
  return [datasets.SplitGenerator(
39
  name=datasets.Split.ALL,
40
  gen_kwargs={
41
- "audio_files": local_extracted_archive,
42
- "metadata": METADATA_DIR},
43
  )]
44
 
45
  def _generate_examples(self, audio_files: Union[str, os.PathLike], metadata: str):
 
12
 
13
  _HOMEPAGE = "https://github.com/salute-developers/golos/tree/master/dusha#dusha-dataset"
14
 
15
+ _DATA_URL = "https://huggingface.co/datasets/KELONMYOSA/dusha_emotion_audio/resolve/main/data.zip"
16
+ _METADATA_URL = "https://huggingface.co/datasets/KELONMYOSA/dusha_emotion_audio/resolve/main/metadata.csv"
17
 
18
 
19
  class Dusha(datasets.GeneratorBasedBuilder):
 
34
  )
35
 
36
  def _split_generators(self, dl_manager):
37
+ metadata = dl_manager.download(_METADATA_URL)
38
+ archive = dl_manager.download(_DATA_URL)
39
  return [datasets.SplitGenerator(
40
  name=datasets.Split.ALL,
41
  gen_kwargs={
42
+ "audio_files": metadata,
43
+ "metadata": dl_manager.iter_archive(archive)},
44
  )]
45
 
46
  def _generate_examples(self, audio_files: Union[str, os.PathLike], metadata: str):