Spaces:
Sleeping
Sleeping
config download access
Browse files- inference_sam.py +2 -1
inference_sam.py
CHANGED
@@ -31,7 +31,8 @@ if not os.path.exists('model'):
|
|
31 |
print(f"Read token:{token}")
|
32 |
if token is None:
|
33 |
print("warning! A read token in env variables is needed for authentication.")
|
34 |
-
|
|
|
35 |
|
36 |
model_path = os.path.join('model', 'sam_02-06_dice_mse_0.pth')
|
37 |
sam = sam_model_registry["default"](model_path)
|
|
|
31 |
print(f"Read token:{token}")
|
32 |
if token is None:
|
33 |
print("warning! A read token in env variables is needed for authentication.")
|
34 |
+
else:
|
35 |
+
snapshot_download(repo_id=REPO_ID, token=token,repo_type='model',local_dir='model')
|
36 |
|
37 |
model_path = os.path.join('model', 'sam_02-06_dice_mse_0.pth')
|
38 |
sam = sam_model_registry["default"](model_path)
|