Spaces:
Runtime error
Runtime error
pengHTYX
commited on
Commit
•
e902be2
1
Parent(s):
7237f7c
'update'
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def sam_init():
|
|
67 |
sam_checkpoint = os.path.join(os.path.dirname(__file__), "sam_pt", "sam_vit_h_4b8939.pth")
|
68 |
model_type = "vit_h"
|
69 |
|
70 |
-
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint).to(device="cuda")
|
71 |
predictor = SamPredictor(sam)
|
72 |
return predictor
|
73 |
|
@@ -296,8 +296,11 @@ def run_demo():
|
|
296 |
|
297 |
pipeline = load_era3d_pipeline(cfg)
|
298 |
torch.set_grad_enabled(False)
|
299 |
-
|
|
|
300 |
pipeline.unet.enable_xformers_memory_efficient_attention()
|
|
|
|
|
301 |
predictor = sam_init()
|
302 |
|
303 |
|
|
|
67 |
sam_checkpoint = os.path.join(os.path.dirname(__file__), "sam_pt", "sam_vit_h_4b8939.pth")
|
68 |
model_type = "vit_h"
|
69 |
|
70 |
+
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint).to(device=f"cuda:{_GPU_ID}")
|
71 |
predictor = SamPredictor(sam)
|
72 |
return predictor
|
73 |
|
|
|
296 |
|
297 |
pipeline = load_era3d_pipeline(cfg)
|
298 |
torch.set_grad_enabled(False)
|
299 |
+
print(1)
|
300 |
+
pipeline.to(device=f'cuda:{_GPU_ID}')
|
301 |
pipeline.unet.enable_xformers_memory_efficient_attention()
|
302 |
+
|
303 |
+
print(2)
|
304 |
predictor = sam_init()
|
305 |
|
306 |
|