Spaces:
Runtime error
Runtime error
Update finetune_xtts_hf.py
Browse files- finetune_xtts_hf.py +2 -3
finetune_xtts_hf.py
CHANGED
|
@@ -16,7 +16,7 @@ subprocess.run([sys.executable, "-m", "pip", "uninstall", "-y", "hf_transfer"])
|
|
| 16 |
# === Configuraci贸n ===
|
| 17 |
HF_MODEL_ID = "tu_usuario/xtts-v2-finetuned" # <--- cambia con tu repo en HF
|
| 18 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Debe estar definido en tu Space/entorno
|
| 19 |
-
DATASET_PATH = "/tmp/dataset" # Ruta a tu dataset
|
| 20 |
OUTPUT_PATH = "/tmp/output_model"
|
| 21 |
BASE_MODEL = "coqui/XTTS-v2"
|
| 22 |
|
|
@@ -73,11 +73,10 @@ def extract_zip(zip_file_path, destination_path):
|
|
| 73 |
|
| 74 |
# Example usage:
|
| 75 |
zip_file = "/home/user/app/voxpopuli_es_500.zip"
|
| 76 |
-
dataset_folder = "/tmp/dataset"
|
| 77 |
|
| 78 |
# To protect against security vulnerabilities, it is important to sanitize the destination path.
|
| 79 |
# This prevents an attacker from using a malicious ZIP file to write outside the destination folder.
|
| 80 |
-
safe_destination = os.path.abspath(
|
| 81 |
|
| 82 |
# Call the function
|
| 83 |
extract_zip(zip_file, safe_destination)
|
|
|
|
| 16 |
# === Configuraci贸n ===
|
| 17 |
HF_MODEL_ID = "tu_usuario/xtts-v2-finetuned" # <--- cambia con tu repo en HF
|
| 18 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Debe estar definido en tu Space/entorno
|
| 19 |
+
DATASET_PATH = "/tmp/dataset/voxpopul_es_500" # Ruta a tu dataset
|
| 20 |
OUTPUT_PATH = "/tmp/output_model"
|
| 21 |
BASE_MODEL = "coqui/XTTS-v2"
|
| 22 |
|
|
|
|
| 73 |
|
| 74 |
# Example usage:
|
| 75 |
zip_file = "/home/user/app/voxpopuli_es_500.zip"
|
|
|
|
| 76 |
|
| 77 |
# To protect against security vulnerabilities, it is important to sanitize the destination path.
|
| 78 |
# This prevents an attacker from using a malicious ZIP file to write outside the destination folder.
|
| 79 |
+
safe_destination = os.path.abspath(DATASET_PATH)
|
| 80 |
|
| 81 |
# Call the function
|
| 82 |
extract_zip(zip_file, safe_destination)
|