dwcodes commited on
Commit
da3b9a3
·
verified ·
1 Parent(s): cec6e42

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import zipfile
3
+ from huggingface_hub import hf_hub_download
4
+
5
+ REPO_ID = "dwcodes/echogallery-wikiart-clip-faiss"
6
+
7
+ # Download the zip file from your model repo
8
+ zip_path = hf_hub_download(REPO_ID, "thumbnails.zip")
9
+
10
+ # Directory where thumbnails will be extracted
11
+ THUMB_DIR = "thumbnails"
12
+
13
+ # Extract only once
14
+ if not os.path.exists(THUMB_DIR):
15
+ os.makedirs(THUMB_DIR, exist_ok=True)
16
+ with zipfile.ZipFile(zip_path, "r") as z:
17
+ z.extractall(THUMB_DIR)