Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit ac1cba3

Browse files
authored
use correct zoo download dir param in onnx tests (#975)
* use correct zoo download dir param in onnx tests * same change in src
1 parent 6836555 commit ac1cba3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/sparseml/onnx/benchmark/info.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ def load_model(model: Any, **kwargs) -> ModelProto:
290290
raise ValueError("Model must not be None type")
291291

292292
if isinstance(model, str) and model.startswith("zoo:"):
293-
model = Model(model)
294-
if "path" in kwargs:
295-
model.path = kwargs["path"]
293+
model = (
294+
Model(model, download_path=kwargs["path"])
295+
if "path" in kwargs
296+
else Model(model)
297+
)
296298

297299
if isinstance(model, Model):
298300
# default to the main onnx file for the model

tests/sparseml/onnx/benchmark/test_info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
@pytest.fixture(scope="module")
3838
def mobilenet_fixture() -> Model:
3939
with tempfile.TemporaryDirectory() as onnx_dir:
40-
model = Model(TEST_STUB)
41-
model.path = onnx_dir
40+
model = Model(TEST_STUB, download_path=onnx_dir)
4241
yield model
4342

4443

0 commit comments

Comments
 (0)