versae commited on
Commit
ddb68e8
1 Parent(s): d69bf15

Fixes sampling rate reporting for 16K_mp3

Browse files
Files changed (1) hide show
  1. NPSC.py +2 -1
NPSC.py CHANGED
@@ -85,6 +85,7 @@ class Npsc(datasets.GeneratorBasedBuilder):
85
  ]
86
 
87
  def _info(self):
 
88
  return datasets.DatasetInfo(
89
  description=_DESCRIPTION,
90
  features=datasets.Features(
@@ -101,7 +102,7 @@ class Npsc(datasets.GeneratorBasedBuilder):
101
  "normsentence_text": datasets.Value("string"),
102
  "transsentence_text": datasets.Value("string"),
103
  "translated": datasets.Value("int32"),
104
- "audio": datasets.features.Audio(sampling_rate=48000),
105
 
106
  }
107
  ),
 
85
  ]
86
 
87
  def _info(self):
88
+ sampling_rate = 16_000 if self.config.name == "16K_mp3" else 48_000
89
  return datasets.DatasetInfo(
90
  description=_DESCRIPTION,
91
  features=datasets.Features(
 
102
  "normsentence_text": datasets.Value("string"),
103
  "transsentence_text": datasets.Value("string"),
104
  "translated": datasets.Value("int32"),
105
+ "audio": datasets.features.Audio(sampling_rate=sampling_rate),
106
 
107
  }
108
  ),