Spaces:
Runtime error
Runtime error
narugo1992
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import json
|
| 2 |
import os
|
| 3 |
from collections import defaultdict
|
| 4 |
-
from functools import lru_cache
|
| 5 |
from typing import List, Dict
|
| 6 |
|
| 7 |
import faiss
|
|
@@ -13,6 +12,7 @@ from cheesechaser.datapool import YandeWebpDataPool, ZerochanWebpDataPool, Gelbo
|
|
| 13 |
from hfutils.operate import get_hf_fs, get_hf_client
|
| 14 |
from hfutils.utils import TemporaryDirectory
|
| 15 |
from imgutils.tagging import wd14
|
|
|
|
| 16 |
|
| 17 |
from pools import quick_webp_pool
|
| 18 |
|
|
@@ -73,7 +73,7 @@ def _get_from_raw_ids(ids: List[str]) -> Dict[str, Image.Image]:
|
|
| 73 |
return _retval
|
| 74 |
|
| 75 |
|
| 76 |
-
@
|
| 77 |
def _get_index_info(repo_id: str, model_name: str):
|
| 78 |
image_ids = np.load(hf_client.hf_hub_download(
|
| 79 |
repo_id=repo_id,
|
|
|
|
| 1 |
import json
|
| 2 |
import os
|
| 3 |
from collections import defaultdict
|
|
|
|
| 4 |
from typing import List, Dict
|
| 5 |
|
| 6 |
import faiss
|
|
|
|
| 12 |
from hfutils.operate import get_hf_fs, get_hf_client
|
| 13 |
from hfutils.utils import TemporaryDirectory
|
| 14 |
from imgutils.tagging import wd14
|
| 15 |
+
from imgutils.utils import ts_lru_cache
|
| 16 |
|
| 17 |
from pools import quick_webp_pool
|
| 18 |
|
|
|
|
| 73 |
return _retval
|
| 74 |
|
| 75 |
|
| 76 |
+
@ts_lru_cache(maxsize=3)
|
| 77 |
def _get_index_info(repo_id: str, model_name: str):
|
| 78 |
image_ids = np.load(hf_client.hf_hub_download(
|
| 79 |
repo_id=repo_id,
|