Datasets:
Tasks:
Text-to-Speech
Modalities:
Audio
Formats:
soundfolder
Languages:
Hausa
Size:
1K - 10K
License:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,10 +1,4 @@
|
|
| 1 |
---
|
| 2 |
-
configs:
|
| 3 |
-
- config_name: default
|
| 4 |
-
data_files:
|
| 5 |
-
- split: train
|
| 6 |
-
path: "data/train-*.parquet"
|
| 7 |
-
default: true
|
| 8 |
language:
|
| 9 |
- ha
|
| 10 |
license: mit
|
|
@@ -58,20 +52,22 @@ Each example contains:
|
|
| 58 |
|
| 59 |
## Usage
|
| 60 |
|
| 61 |
-
### Basic Loading
|
|
|
|
|
|
|
| 62 |
|
| 63 |
```python
|
| 64 |
from datasets import load_dataset, Audio
|
| 65 |
|
| 66 |
-
# Load dataset
|
| 67 |
dataset = load_dataset("Aybee5/HausaTTSEmbed", split="train")
|
| 68 |
|
| 69 |
-
#
|
| 70 |
dataset = dataset.cast_column("audio", Audio(sampling_rate=22050))
|
| 71 |
|
| 72 |
print(f"Loaded {len(dataset)} samples")
|
| 73 |
|
| 74 |
-
# Access first sample
|
| 75 |
sample = dataset[0]
|
| 76 |
print(f"Text: {sample['text']}")
|
| 77 |
print(f"Speaker: {sample['speaker_id']}")
|
|
@@ -79,6 +75,8 @@ print(f"Audio shape: {sample['audio']['array'].shape}")
|
|
| 79 |
print(f"Sample rate: {sample['audio']['sampling_rate']}")
|
| 80 |
```
|
| 81 |
|
|
|
|
|
|
|
| 82 |
### For Unsloth TTS Training
|
| 83 |
|
| 84 |
This dataset is optimized for Unsloth TTS training:
|
|
@@ -98,7 +96,7 @@ if "source" not in raw_ds.column_names and "speaker_id" not in raw_ds.column_nam
|
|
| 98 |
elif "source" not in raw_ds.column_names and "speaker_id" in raw_ds.column_names:
|
| 99 |
speaker_key = "speaker_id"
|
| 100 |
|
| 101 |
-
# Resample to target sample rate
|
| 102 |
target_sampling_rate = 24000
|
| 103 |
raw_ds = raw_ds.cast_column("audio", Audio(sampling_rate=target_sampling_rate))
|
| 104 |
|
|
@@ -110,6 +108,8 @@ val_ds = split_ds['test']
|
|
| 110 |
print(f"Train: {len(train_ds)}, Validation: {len(val_ds)}")
|
| 111 |
```
|
| 112 |
|
|
|
|
|
|
|
| 113 |
### With Transformers
|
| 114 |
|
| 115 |
```python
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- ha
|
| 4 |
license: mit
|
|
|
|
| 52 |
|
| 53 |
## Usage
|
| 54 |
|
| 55 |
+
### Basic Loading (Recommended)
|
| 56 |
+
|
| 57 |
+
The dataset will automatically download audio files when you access them:
|
| 58 |
|
| 59 |
```python
|
| 60 |
from datasets import load_dataset, Audio
|
| 61 |
|
| 62 |
+
# Load dataset - this downloads the parquet file
|
| 63 |
dataset = load_dataset("Aybee5/HausaTTSEmbed", split="train")
|
| 64 |
|
| 65 |
+
# Cast audio column - this tells HF to download audio files when accessed
|
| 66 |
dataset = dataset.cast_column("audio", Audio(sampling_rate=22050))
|
| 67 |
|
| 68 |
print(f"Loaded {len(dataset)} samples")
|
| 69 |
|
| 70 |
+
# Access first sample - audio file is downloaded automatically
|
| 71 |
sample = dataset[0]
|
| 72 |
print(f"Text: {sample['text']}")
|
| 73 |
print(f"Speaker: {sample['speaker_id']}")
|
|
|
|
| 75 |
print(f"Sample rate: {sample['audio']['sampling_rate']}")
|
| 76 |
```
|
| 77 |
|
| 78 |
+
**Note:** Audio files are downloaded on-demand when you access them. For batch processing, they'll be cached locally.
|
| 79 |
+
|
| 80 |
### For Unsloth TTS Training
|
| 81 |
|
| 82 |
This dataset is optimized for Unsloth TTS training:
|
|
|
|
| 96 |
elif "source" not in raw_ds.column_names and "speaker_id" in raw_ds.column_names:
|
| 97 |
speaker_key = "speaker_id"
|
| 98 |
|
| 99 |
+
# Resample to target sample rate - downloads audio files as needed
|
| 100 |
target_sampling_rate = 24000
|
| 101 |
raw_ds = raw_ds.cast_column("audio", Audio(sampling_rate=target_sampling_rate))
|
| 102 |
|
|
|
|
| 108 |
print(f"Train: {len(train_ds)}, Validation: {len(val_ds)}")
|
| 109 |
```
|
| 110 |
|
| 111 |
+
**Important for Colab/Remote:** Audio files are automatically downloaded from HuggingFace when accessed. The first access will download and cache the files.
|
| 112 |
+
|
| 113 |
### With Transformers
|
| 114 |
|
| 115 |
```python
|