Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,24 @@
|
|
|
|
1 |
import os
|
2 |
|
3 |
zip_path = "model/kokoro-v1_0.zip"
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import zipfile
|
2 |
import os
|
3 |
|
4 |
zip_path = "model/kokoro-v1_0.zip"
|
5 |
+
extract_dir = "model/"
|
6 |
+
|
7 |
+
try:
|
8 |
+
# Ensure the ZIP file exists
|
9 |
+
if not os.path.exists(zip_path):
|
10 |
+
raise FileNotFoundError(f"ZIP file not found at {zip_path}")
|
11 |
+
|
12 |
+
# Attempt extraction
|
13 |
+
print(f"Extracting {zip_path}...")
|
14 |
+
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
15 |
+
zip_ref.extractall(extract_dir)
|
16 |
+
|
17 |
+
# Confirm the extraction
|
18 |
+
extracted_files = os.listdir(extract_dir)
|
19 |
+
print(f"Extraction completed. Extracted files: {extracted_files}")
|
20 |
+
|
21 |
+
except zipfile.BadZipFile:
|
22 |
+
print(f"Error: {zip_path} is not a valid ZIP file.")
|
23 |
+
except Exception as e:
|
24 |
+
print(f"Error during extraction: {e}")
|