Spaces:
Runtime error
Runtime error
Update finetune_xtts_hf.py
Browse files- finetune_xtts_hf.py +8 -7
finetune_xtts_hf.py
CHANGED
|
@@ -22,14 +22,15 @@ 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 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
'
|
| 30 |
-
)
|
| 31 |
|
| 32 |
-
print(
|
| 33 |
|
| 34 |
# === Iniciar entrenamiento XTTSv2 ===
|
| 35 |
print("=== Iniciando entrenamiento XTTSv2 ===")
|
|
@@ -58,5 +59,5 @@ api.upload_folder(
|
|
| 58 |
token=HF_TOKEN
|
| 59 |
)
|
| 60 |
|
| 61 |
-
print(
|
| 62 |
|
|
|
|
| 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 = {
|
| 26 |
+
"audio_file": sample["audio_file"],
|
| 27 |
+
"text": sample["text"],
|
| 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 |
token=HF_TOKEN
|
| 60 |
)
|
| 61 |
|
| 62 |
+
print(" Fine-tuning completado y subido a {HF_REPO_ID}")
|
| 63 |
|