Commit
·
9551df9
1
Parent(s):
fa6cc29
Change default device setting to CPU in app.py for improved compatibility. Updated model loading to ensure it operates on CPU, enhancing performance on systems without GPU support.
Browse files
app.py
CHANGED
@@ -154,14 +154,15 @@ parser.add_argument(
|
|
154 |
help="config for stage2",
|
155 |
)
|
156 |
|
157 |
-
|
|
|
158 |
args = parser.parse_args()
|
159 |
|
160 |
crm_path = hf_hub_download(repo_id="Zhengyi/CRM", filename="CRM.pth")
|
161 |
specs = json.load(open("configs/specs_objaverse_total.json"))
|
162 |
model = CRM(specs)
|
163 |
model.load_state_dict(torch.load(crm_path, map_location="cpu"), strict=False)
|
164 |
-
model = model.to(
|
165 |
|
166 |
stage1_config = OmegaConf.load(args.stage1_config).config
|
167 |
stage2_config = OmegaConf.load(args.stage2_config).config
|
|
|
154 |
help="config for stage2",
|
155 |
)
|
156 |
|
157 |
+
# Force CPU usage
|
158 |
+
parser.add_argument("--device", type=str, default="cpu")
|
159 |
args = parser.parse_args()
|
160 |
|
161 |
crm_path = hf_hub_download(repo_id="Zhengyi/CRM", filename="CRM.pth")
|
162 |
specs = json.load(open("configs/specs_objaverse_total.json"))
|
163 |
model = CRM(specs)
|
164 |
model.load_state_dict(torch.load(crm_path, map_location="cpu"), strict=False)
|
165 |
+
model = model.to("cpu")
|
166 |
|
167 |
stage1_config = OmegaConf.load(args.stage1_config).config
|
168 |
stage2_config = OmegaConf.load(args.stage2_config).config
|