Datasets:
Update simple_tamil.py
Browse files- simple_tamil.py +3 -3
simple_tamil.py
CHANGED
|
@@ -53,7 +53,7 @@ class simple_data(datasets.GeneratorBasedBuilder):
|
|
| 53 |
features = datasets.Features(
|
| 54 |
{
|
| 55 |
"audio": datasets.Audio(sampling_rate=16_000),
|
| 56 |
-
"
|
| 57 |
"sentence": datasets.Value("string"),
|
| 58 |
}
|
| 59 |
)
|
|
@@ -104,7 +104,7 @@ class simple_data(datasets.GeneratorBasedBuilder):
|
|
| 104 |
with open(metadata_path, encoding="utf-8") as f:
|
| 105 |
for key, row in enumerate(f):
|
| 106 |
data = json.loads(row)
|
| 107 |
-
examples[data["
|
| 108 |
inside_clips_dir = False
|
| 109 |
id_ = 0
|
| 110 |
for path, f in audio_files:
|
|
@@ -114,7 +114,7 @@ class simple_data(datasets.GeneratorBasedBuilder):
|
|
| 114 |
result = examples[path]
|
| 115 |
path = os.path.join(local_extracted_archive, path) if local_extracted_archive else path
|
| 116 |
result["audio"] = {"path": path, "bytes": f.read()}
|
| 117 |
-
result["
|
| 118 |
yield id_, result
|
| 119 |
id_ += 1
|
| 120 |
elif inside_clips_dir:
|
|
|
|
| 53 |
features = datasets.Features(
|
| 54 |
{
|
| 55 |
"audio": datasets.Audio(sampling_rate=16_000),
|
| 56 |
+
"path": datasets.Value("string"),
|
| 57 |
"sentence": datasets.Value("string"),
|
| 58 |
}
|
| 59 |
)
|
|
|
|
| 104 |
with open(metadata_path, encoding="utf-8") as f:
|
| 105 |
for key, row in enumerate(f):
|
| 106 |
data = json.loads(row)
|
| 107 |
+
examples[data["path"]] = data
|
| 108 |
inside_clips_dir = False
|
| 109 |
id_ = 0
|
| 110 |
for path, f in audio_files:
|
|
|
|
| 114 |
result = examples[path]
|
| 115 |
path = os.path.join(local_extracted_archive, path) if local_extracted_archive else path
|
| 116 |
result["audio"] = {"path": path, "bytes": f.read()}
|
| 117 |
+
result["path"] = path
|
| 118 |
yield id_, result
|
| 119 |
id_ += 1
|
| 120 |
elif inside_clips_dir:
|