Skip to content

Commit

Permalink
[bugfix] model_to_path should also download .data files from zoo (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfineran committed Oct 4, 2023
1 parent 5d022a7 commit 09ad1d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/deepsparse/utils/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ def model_to_path(model: Union[str, Model, File]) -> str:
model = Model(model)

if Model is not object and isinstance(model, Model):
# download any onnx data files in deployment directory
for deployment_file in model.deployment.files:
if ".data" in deployment_file.name:
# forces download of data file if not cached
deployment_file.path

# default to the main onnx file for the model
model = model.deployment.get_file(_MODEL_DIR_ONNX_NAME).path

Expand Down

0 comments on commit 09ad1d9

Please sign in to comment.