Muhammad Taqi Raza
commited on
Commit
·
fcac2ca
1
Parent(s):
376cb79
add app files
Browse files
app.py
CHANGED
@@ -16,11 +16,24 @@ if not os.path.exists(MODEL_PATH) or len(os.listdir(MODEL_PATH)) == 0:
|
|
16 |
snapshot_download(
|
17 |
repo_id=MODEL_REPO,
|
18 |
repo_type="dataset",
|
19 |
-
local_dir=
|
20 |
local_dir_use_symlinks=False
|
21 |
)
|
22 |
print("✅ Download complete.")
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
# ----------------------------------------
|
25 |
# Step 2: Setup Directories
|
26 |
# ----------------------------------------
|
|
|
16 |
snapshot_download(
|
17 |
repo_id=MODEL_REPO,
|
18 |
repo_type="dataset",
|
19 |
+
local_dir=MODEL_PATH,
|
20 |
local_dir_use_symlinks=False
|
21 |
)
|
22 |
print("✅ Download complete.")
|
23 |
|
24 |
+
def list_downloaded_files(model_path):
|
25 |
+
lines = []
|
26 |
+
for root, dirs, files in os.walk(model_path):
|
27 |
+
level = root.replace(model_path, "").count(os.sep)
|
28 |
+
indent = " " * level
|
29 |
+
lines.append(f"{indent}📁 {os.path.basename(root) or 'DOVE'}/")
|
30 |
+
subindent = " " * (level + 1)
|
31 |
+
for f in sorted(files):
|
32 |
+
lines.append(f"{subindent}📄 {f}")
|
33 |
+
return "\n".join(lines)
|
34 |
+
file_tree = list_downloaded_files(MODEL_PATH)
|
35 |
+
gr.Textbox(value=file_tree, label="Downloaded Files Tree", lines=20)
|
36 |
+
|
37 |
# ----------------------------------------
|
38 |
# Step 2: Setup Directories
|
39 |
# ----------------------------------------
|