Skip to content

Commit 42a74be

Browse files
authored
Update local_fixes.py
1 parent fba79e2 commit 42a74be

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Fixes/local_fixes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def replace_in_file(file_name, old_text, new_text):
7979

8080
def find_torchcrepe_directory(directory):
8181
"""
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.
8484
"""
8585
for root, dirs, files in os.walk(directory):
8686
if 'torchcrepe' in dirs:
@@ -96,40 +96,40 @@ def download_and_extract_torchcrepe():
9696
torchcrepe_dir_path = os.path.join(destination_dir, 'torchcrepe')
9797

9898
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.")
100100
return
101101

102102
# Download the file
103-
print("Starting torchcrepe download...")
103+
print("Iniciando la descarga de torchcrepe...")
104104
response = requests.get(url)
105105

106106
# Raise an error if the GET request was unsuccessful
107107
response.raise_for_status()
108-
print("Download finished.")
108+
print("Descarga finalizada.")
109109

110110
# Save the downloaded file
111111
zip_file_path = os.path.join(temp_dir, 'master.zip')
112112
os.makedirs(temp_dir, exist_ok=True)
113113
with open(zip_file_path, 'wb') as file:
114114
file.write(response.content)
115-
print(f"Saved zip file to {zip_file_path}")
115+
print(f"Archivo zip guardado en {zip_file_path}")
116116

117117
# Extract the zip file
118-
print("Extracting contents...")
118+
print("Extrayendo contenidos...")
119119
with zipfile.ZipFile(zip_file_path, 'r') as zip_file:
120120
zip_file.extractall(temp_dir)
121-
print("Extraction finished.")
121+
print("Extracción finalizada.")
122122

123123
# Locate the torchcrepe folder and move it to the destination directory
124124
torchcrepe_dir = find_torchcrepe_directory(temp_dir)
125125
if torchcrepe_dir:
126126
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}!")
128128
else:
129-
print("Could not locate the torchcrepe directory.")
129+
print("No se pudo localizar el directorio de torchcrepe.")
130130

131131
except Exception as e:
132-
print("Torchcrepe not downloaded successfully?", e)
132+
print("Torchcrepe no descargado con éxito?", e)
133133

134134
# Clean up temporary directory
135135
if os.path.exists(temp_dir):

0 commit comments

Comments
 (0)