Spaces:
Runtime error
Runtime error
jhj0517
commited on
Commit
•
e42652b
1
Parent(s):
dcdb677
Add model_dir to `is_sam_exist`
Browse files
modules/model_downloader.py
CHANGED
@@ -42,7 +42,12 @@ def load_file_from_url(
|
|
42 |
return cached_file
|
43 |
|
44 |
|
45 |
-
def is_sam_exist(
|
|
|
|
|
|
|
|
|
|
|
46 |
filename, url = AVAILABLE_MODELS[model_type]
|
47 |
-
model_path = os.path.join(
|
48 |
return os.path.exists(model_path)
|
|
|
42 |
return cached_file
|
43 |
|
44 |
|
45 |
+
def is_sam_exist(
|
46 |
+
model_type: str,
|
47 |
+
model_dir: Optional[str] = None
|
48 |
+
):
|
49 |
+
if model_dir is None:
|
50 |
+
model_dir = MODELS_DIR
|
51 |
filename, url = AVAILABLE_MODELS[model_type]
|
52 |
+
model_path = os.path.join(model_dir, filename)
|
53 |
return os.path.exists(model_path)
|