Create app.py
Browse files
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)
|