@@ -79,8 +79,8 @@ def replace_in_file(file_name, old_text, new_text):
79
79
80
80
def find_torchcrepe_directory (directory ):
81
81
"""
82
- Recursively searches for the highest hierarchy folder named 'torchcrepe' within a directory .
83
- Returns the path of the found directory or None if not found .
82
+ Busca recursivamente la carpeta de mayor jerarquía denominada 'torchcrepe' dentro de un directorio .
83
+ Devuelve la ruta del directorio encontrado o Ninguno si no se encuentra .
84
84
"""
85
85
for root , dirs , files in os .walk (directory ):
86
86
if 'torchcrepe' in dirs :
@@ -96,40 +96,40 @@ def download_and_extract_torchcrepe():
96
96
torchcrepe_dir_path = os .path .join (destination_dir , 'torchcrepe' )
97
97
98
98
if os .path .exists (torchcrepe_dir_path ):
99
- print ("Skipping torchcrepe download. Folder already exists ." )
99
+ print ("Saltando la descarga de torchcrepe. La carpeta ya existe ." )
100
100
return
101
101
102
102
# Download the file
103
- print ("Starting torchcrepe download ..." )
103
+ print ("Iniciando la descarga de torchcrepe ..." )
104
104
response = requests .get (url )
105
105
106
106
# Raise an error if the GET request was unsuccessful
107
107
response .raise_for_status ()
108
- print ("Download finished ." )
108
+ print ("Descarga finalizada ." )
109
109
110
110
# Save the downloaded file
111
111
zip_file_path = os .path .join (temp_dir , 'master.zip' )
112
112
os .makedirs (temp_dir , exist_ok = True )
113
113
with open (zip_file_path , 'wb' ) as file :
114
114
file .write (response .content )
115
- print (f"Saved zip file to { zip_file_path } " )
115
+ print (f"Archivo zip guardado en { zip_file_path } " )
116
116
117
117
# Extract the zip file
118
- print ("Extracting contents ..." )
118
+ print ("Extrayendo contenidos ..." )
119
119
with zipfile .ZipFile (zip_file_path , 'r' ) as zip_file :
120
120
zip_file .extractall (temp_dir )
121
- print ("Extraction finished ." )
121
+ print ("Extracción finalizada ." )
122
122
123
123
# Locate the torchcrepe folder and move it to the destination directory
124
124
torchcrepe_dir = find_torchcrepe_directory (temp_dir )
125
125
if torchcrepe_dir :
126
126
shutil .move (torchcrepe_dir , destination_dir )
127
- print (f"Moved torchcrepe directory to { destination_dir } !" )
127
+ print (f"Se movió el directorio torchcrepe a { destination_dir } !" )
128
128
else :
129
- print ("Could not locate the torchcrepe directory ." )
129
+ print ("No se pudo localizar el directorio de torchcrepe ." )
130
130
131
131
except Exception as e :
132
- print ("Torchcrepe not downloaded successfully ?" , e )
132
+ print ("Torchcrepe no descargado con éxito ?" , e )
133
133
134
134
# Clean up temporary directory
135
135
if os .path .exists (temp_dir ):
0 commit comments