Spaces:
Runtime error
Runtime error
Commit
·
ec909a7
1
Parent(s):
990eebb
Update app.py
Browse files
app.py
CHANGED
@@ -3,30 +3,30 @@ from share_btn import community_icon_html, loading_icon_html, share_js
|
|
3 |
import os, subprocess
|
4 |
import torch
|
5 |
|
6 |
-
def setup():
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
setup()
|
17 |
-
|
18 |
-
# download cache files
|
19 |
-
print("Download preprocessed cache files...")
|
20 |
-
CACHE_URLS = [
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
]
|
27 |
-
os.makedirs('cache', exist_ok=True)
|
28 |
-
for url in CACHE_URLS:
|
29 |
-
|
30 |
|
31 |
import sys
|
32 |
sys.path.append('src/blip')
|
|
|
3 |
import os, subprocess
|
4 |
import torch
|
5 |
|
6 |
+
# def setup():
|
7 |
+
# install_cmds = [
|
8 |
+
# ['pip', 'install', 'ftfy', 'gradio', 'regex', 'tqdm', 'transformers==4.21.2', 'timm', 'fairscale', 'requests'],
|
9 |
+
# ['pip', 'install', 'open_clip_torch'],
|
10 |
+
# ['pip', 'install', '-e', 'git+https://github.com/pharmapsychotic/BLIP.git@lib#egg=blip'],
|
11 |
+
# ['git', 'clone', '-b', 'open-clip', 'https://github.com/pharmapsychotic/clip-interrogator.git']
|
12 |
+
# ]
|
13 |
+
# for cmd in install_cmds:
|
14 |
+
# print(subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8'))
|
15 |
+
|
16 |
+
# setup()
|
17 |
+
|
18 |
+
# # download cache files
|
19 |
+
# print("Download preprocessed cache files...")
|
20 |
+
# CACHE_URLS = [
|
21 |
+
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_artists.pkl',
|
22 |
+
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_flavors.pkl',
|
23 |
+
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_mediums.pkl',
|
24 |
+
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_movements.pkl',
|
25 |
+
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_trendings.pkl',
|
26 |
+
# ]
|
27 |
+
# os.makedirs('cache', exist_ok=True)
|
28 |
+
# for url in CACHE_URLS:
|
29 |
+
# print(subprocess.run(['wget', url, '-P', 'cache'], stdout=subprocess.PIPE).stdout.decode('utf-8'))
|
30 |
|
31 |
import sys
|
32 |
sys.path.append('src/blip')
|