Spaces:
Sleeping
Sleeping
AI Agent commited on
Commit ·
c1dd13e
1
Parent(s): b90ddcd
CRITICAL FIX: Pass ckpt_path to build_sam3_image_model() to prevent internal download hang without HF token
Browse files
app.py
CHANGED
|
@@ -85,12 +85,10 @@ processor = None
|
|
| 85 |
|
| 86 |
if model_installed:
|
| 87 |
print(f"Loading SAM 3 onto {device}...")
|
| 88 |
-
model = build_sam3_image_model()
|
| 89 |
-
# NOTE: build_sam3_image_model()
|
| 90 |
-
#
|
| 91 |
-
|
| 92 |
-
model.to(device)
|
| 93 |
-
model.to(torch.float32) # Lossless 32-bit execution prevents BFloat16 exponent overflows (NaNs)
|
| 94 |
|
| 95 |
processor = Sam3Processor(model)
|
| 96 |
if not torch.cuda.is_available():
|
|
|
|
| 85 |
|
| 86 |
if model_installed:
|
| 87 |
print(f"Loading SAM 3 onto {device}...")
|
| 88 |
+
model = build_sam3_image_model(checkpoint_path=ckpt_path)
|
| 89 |
+
# NOTE: build_sam3_image_model() internally loads weights, remaps keys,
|
| 90 |
+
# and calls model.cuda().eval(). We just need to cast to float32 for T4.
|
| 91 |
+
model.to(torch.float32)
|
|
|
|
|
|
|
| 92 |
|
| 93 |
processor = Sam3Processor(model)
|
| 94 |
if not torch.cuda.is_available():
|