Spaces:
Runtime error
Runtime error
Update finetune_xtts_hf.py
Browse files- finetune_xtts_hf.py +5 -3
finetune_xtts_hf.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import subprocess
|
|
|
|
| 3 |
from huggingface_hub import HfApi, HfFolder
|
| 4 |
from datasets import load_dataset
|
| 5 |
|
|
@@ -20,6 +21,7 @@ ds = load_dataset("sob111/voxpopuli_es_500", split="train", token=HF_TOKEN)
|
|
| 20 |
# Guardar metadata.json en el formato esperado por Coqui TTS
|
| 21 |
os.makedirs("./voxpopuli_es_500", exist_ok=True)
|
| 22 |
meta_file = "./voxpopuli_es_500/metadata.json"
|
|
|
|
| 23 |
with open(meta_file, "w", encoding="utf-8") as f:
|
| 24 |
for sample in ds:
|
| 25 |
entry = {
|
|
@@ -28,9 +30,8 @@ with open(meta_file, "w", encoding="utf-8") as f:
|
|
| 28 |
"speaker_name": sample.get("speaker_name", "speaker")
|
| 29 |
}
|
| 30 |
f.write(json.dumps(entry, ensure_ascii=False) + "\n")
|
| 31 |
-
'
|
| 32 |
|
| 33 |
-
print(" Metadata guardada en {meta_file}")
|
| 34 |
|
| 35 |
# === Iniciar entrenamiento XTTSv2 ===
|
| 36 |
print("=== Iniciando entrenamiento XTTSv2 ===")
|
|
@@ -59,5 +60,6 @@ api.upload_folder(
|
|
| 59 |
token=HF_TOKEN
|
| 60 |
)
|
| 61 |
|
| 62 |
-
print(" Fine-tuning completado y subido a {HF_REPO_ID}")
|
|
|
|
| 63 |
|
|
|
|
| 1 |
import os
|
| 2 |
import subprocess
|
| 3 |
+
import json
|
| 4 |
from huggingface_hub import HfApi, HfFolder
|
| 5 |
from datasets import load_dataset
|
| 6 |
|
|
|
|
| 21 |
# Guardar metadata.json en el formato esperado por Coqui TTS
|
| 22 |
os.makedirs("./voxpopuli_es_500", exist_ok=True)
|
| 23 |
meta_file = "./voxpopuli_es_500/metadata.json"
|
| 24 |
+
|
| 25 |
with open(meta_file, "w", encoding="utf-8") as f:
|
| 26 |
for sample in ds:
|
| 27 |
entry = {
|
|
|
|
| 30 |
"speaker_name": sample.get("speaker_name", "speaker")
|
| 31 |
}
|
| 32 |
f.write(json.dumps(entry, ensure_ascii=False) + "\n")
|
|
|
|
| 33 |
|
| 34 |
+
print("✅ Metadata guardada en {meta_file}")
|
| 35 |
|
| 36 |
# === Iniciar entrenamiento XTTSv2 ===
|
| 37 |
print("=== Iniciando entrenamiento XTTSv2 ===")
|
|
|
|
| 60 |
token=HF_TOKEN
|
| 61 |
)
|
| 62 |
|
| 63 |
+
print("✅ Fine-tuning completado y subido a {HF_REPO_ID}")
|
| 64 |
+
|
| 65 |
|