jhj0517 commited on
Commit
e42652b
1 Parent(s): dcdb677

Add model_dir to `is_sam_exist`

Browse files
Files changed (1) hide show
  1. modules/model_downloader.py +7 -2
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(model_type: str):
 
 
 
 
 
46
  filename, url = AVAILABLE_MODELS[model_type]
47
- model_path = os.path.join(MODELS_DIR, filename)
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)