Update setup.py
Browse files
setup.py
CHANGED
@@ -2,19 +2,29 @@ from huggingface_hub import hf_hub_url, cached_download
|
|
2 |
from huggingface_hub.archive import unpack_archive
|
3 |
|
4 |
|
5 |
-
|
6 |
-
archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
# Replace with your desired destination directory
|
13 |
-
|
14 |
-
# Construct the destination path
|
15 |
-
destination_path = hf_hub_url(destination_dir)
|
16 |
-
# Download the archive to the destination path
|
17 |
-
cached_download(archive_url, destination_path)
|
18 |
-
# Unpack the archive
|
19 |
-
unpack_archive(destination_path, destination_dir)
|
20 |
-
print(f"Archive unpacked to: {destination_dir}")
|
|
|
2 |
from huggingface_hub.archive import unpack_archive
|
3 |
|
4 |
|
5 |
+
def downlad_images() :
|
|
|
6 |
|
7 |
+
img_dir = 'flickr'
|
8 |
+
|
9 |
+
if not os.path.exists(img_dir) :
|
10 |
+
st.write("NEEED to download")
|
11 |
+
|
12 |
+
# os.makedirs(sample_dir, exist_ok=True)
|
13 |
+
# # Specify the Google Drive link to the archive file
|
14 |
+
# archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
|
15 |
+
|
16 |
+
# # Specify the destination directory within the Hugging Face space
|
17 |
+
# destination_dir = 'osanchik/flickr'
|
18 |
+
|
19 |
+
|
20 |
+
# # Replace with your desired destination directory
|
21 |
+
|
22 |
+
# # Construct the destination path
|
23 |
+
# destination_path = hf_hub_url(destination_dir)
|
24 |
+
# # Download the archive to the destination path
|
25 |
+
# cached_download(archive_url, destination_path)
|
26 |
+
# # Unpack the archive
|
27 |
+
# unpack_archive(destination_path, destination_dir)
|
28 |
+
# print(f"Archive unpacked to: {destination_dir}")
|
29 |
|
30 |
+
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|