sob111 commited on
Commit
dd069ba
·
verified ·
1 Parent(s): 57214cb

Update finetune_xtts_hf.py

Browse files
Files changed (1) hide show
  1. 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
- f.write(
26
- f'{{"audio_file": "{sample["audio_file"]}", '
27
- f'"text": "{sample["text"]}", '
28
- f'"speaker_name": "{sample.get("speaker_name", "speaker")}"}}
 
 
29
  '
30
- )
31
 
32
- print(f" Metadata guardada en {meta_file}")
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(f" Fine-tuning completado y subido a {HF_REPO_ID}")
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