Hassan-16 commited on
Commit
799287a
·
verified ·
1 Parent(s): 1679d95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -22
app.py CHANGED
@@ -1,24 +1,13 @@
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}")
 
 
1
  import os
2
 
3
+ required_files = [
4
+ "model/kokoro-v1_0.pth",
5
+ "model/config.json",
6
+ # Add other essential files here
7
+ ]
8
+
9
+ for file in required_files:
10
+ if not os.path.exists(file):
11
+ print(f"Error: Required file {file} not found!")
12
+ else:
13
+ print(f"File {file} is present.")