Skip to content

Commit 1b27b29

Browse files
committed
Update shared.py
1 parent 3c94128 commit 1b27b29

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

src/shared/shared.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,6 @@ def load_model():
9191
if classifier is None:
9292
logger.info("DEFAULT MODEL: " + default_model_name)
9393

94-
cache_root = os.environ.get(
95-
"HF_HOME", os.path.expanduser("~/.cache/huggingface")
96-
)
97-
model_cache_name = default_model_name.replace("/", "--")
98-
cache_path = f"{cache_root}/hub/models--{model_cache_name}"
99-
cache_exists = os.path.exists(cache_path)
100-
101-
if cache_exists:
102-
logger.info("Model found in cache, deleting and redownloading")
103-
shutil.rmtree(cache_path)
104-
else:
105-
logger.info("Model not found in cache, will download")
106-
10794
classifier = pipeline(
10895
"image-classification",
10996
model=default_model_name,

0 commit comments

Comments
 (0)