Commit
β’
fd8aa7c
1
Parent(s):
db82445
add progress bar
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from huggingface_hub import get_collection
|
|
7 |
from cytoolz import groupby
|
8 |
from collections import defaultdict
|
9 |
import os
|
10 |
-
|
11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
12 |
is_macos = platform.system() == "Darwin"
|
13 |
LIMIT = None
|
@@ -15,12 +15,12 @@ CACHE_TIME = 60 * 5 # 5 minutes
|
|
15 |
|
16 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
17 |
def get_models():
|
18 |
-
return list(iter(list_models(full=True, limit=LIMIT)))
|
19 |
|
20 |
|
21 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
22 |
def get_datasets():
|
23 |
-
return list(iter(list_datasets(full=True, limit=LIMIT)))
|
24 |
|
25 |
|
26 |
get_models() # warm up the cache
|
|
|
7 |
from cytoolz import groupby
|
8 |
from collections import defaultdict
|
9 |
import os
|
10 |
+
from tqdm.auto import tqdm
|
11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
12 |
is_macos = platform.system() == "Darwin"
|
13 |
LIMIT = None
|
|
|
15 |
|
16 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
17 |
def get_models():
|
18 |
+
return list(tqdm(iter(list_models(full=True, limit=LIMIT))))
|
19 |
|
20 |
|
21 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
22 |
def get_datasets():
|
23 |
+
return list(tqdm(iter(list_datasets(full=True, limit=LIMIT))))
|
24 |
|
25 |
|
26 |
get_models() # warm up the cache
|