Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ def initialize_models(sam_path, adapter_pth, model_cfg, cfg):
|
|
96 |
|
97 |
# Mask Adapter模型初始化
|
98 |
if mask_adapter is None:
|
99 |
-
mask_adapter = build_mask_adapter(cfg, "MASKAdapterHead").
|
100 |
# 加载Adapter状态字典
|
101 |
adapter_state_dict = torch.load(adapter_pth, map_location=torch.device('cpu'))
|
102 |
mask_adapter.load_state_dict(adapter_state_dict)
|
|
|
96 |
|
97 |
# Mask Adapter模型初始化
|
98 |
if mask_adapter is None:
|
99 |
+
mask_adapter = build_mask_adapter(cfg, "MASKAdapterHead").cpu()
|
100 |
# 加载Adapter状态字典
|
101 |
adapter_state_dict = torch.load(adapter_pth, map_location=torch.device('cpu'))
|
102 |
mask_adapter.load_state_dict(adapter_state_dict)
|