Datasets:
License:
jayliqinzhang
commited on
Commit
•
795f52c
1
Parent(s):
02192be
Upload mumospee_small.py with huggingface_hub
Browse files- mumospee_small.py +5 -5
mumospee_small.py
CHANGED
@@ -73,26 +73,26 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
73 |
return [
|
74 |
datasets.SplitGenerator(
|
75 |
name=datasets.Split.TRAIN,
|
76 |
-
gen_kwargs={"
|
77 |
),
|
78 |
datasets.SplitGenerator(
|
79 |
name=datasets.Split.VALIDATION,
|
80 |
-
gen_kwargs={"
|
81 |
),
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TEST,
|
84 |
-
gen_kwargs={"
|
85 |
),
|
86 |
]
|
87 |
|
88 |
|
89 |
-
def _generate_examples(self,
|
90 |
"""Generate examples from the CSV data and audio URLs."""
|
91 |
# Use dl_manager to get the CSV file from the Hugging Face repo
|
92 |
# csv_file = dl_manager.download_and_extract("metadata.csv")
|
93 |
# Read the CSV metadata
|
94 |
|
95 |
-
data = pd.read_csv(
|
96 |
# Filter by primary split
|
97 |
data_split = data[data["split"] == split]
|
98 |
|
|
|
73 |
return [
|
74 |
datasets.SplitGenerator(
|
75 |
name=datasets.Split.TRAIN,
|
76 |
+
gen_kwargs={"filepath": csv_path, "split": "train", "language": _LANGUAGES, "tag": _TAGS}
|
77 |
),
|
78 |
datasets.SplitGenerator(
|
79 |
name=datasets.Split.VALIDATION,
|
80 |
+
gen_kwargs={"filepath": csv_path, "split": "validation", "language": _LANGUAGES, "tag": _TAGS}
|
81 |
),
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TEST,
|
84 |
+
gen_kwargs={"filepath": csv_path, "split": "test", "language": _LANGUAGES, "tag": _TAGS}
|
85 |
),
|
86 |
]
|
87 |
|
88 |
|
89 |
+
def _generate_examples(self, filepath, split, language, tag):
|
90 |
"""Generate examples from the CSV data and audio URLs."""
|
91 |
# Use dl_manager to get the CSV file from the Hugging Face repo
|
92 |
# csv_file = dl_manager.download_and_extract("metadata.csv")
|
93 |
# Read the CSV metadata
|
94 |
|
95 |
+
data = pd.read_csv(filepath)
|
96 |
# Filter by primary split
|
97 |
data_split = data[data["split"] == split]
|
98 |
|