Skip to content

Commit

Permalink
feat(ml): add cache_dir option to OpenVINO EP (#8018)
Browse files Browse the repository at this point in the history
* add cache_dir option to OpenVINO EP

* update provider options test to include cache_dir

* use forward slash instead of string concatenation

* fix cache_dir placement in provider options assertion
  • Loading branch information
dvdblg committed Mar 17, 2024
1 parent b827840 commit e8f0f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion machine-learning/app/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def provider_options_default(self) -> list[dict[str, Any]]:
case "CPUExecutionProvider" | "CUDAExecutionProvider":
option = {"arena_extend_strategy": "kSameAsRequested"}
case "OpenVINOExecutionProvider":
option = {"device_type": "GPU_FP32"}
option = {"device_type": "GPU_FP32", "cache_dir": (self.cache_dir / "openvino").as_posix()}
case _:
option = {}
options.append(option)
Expand Down
2 changes: 1 addition & 1 deletion machine-learning/app/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_sets_default_provider_options(self, mocker: MockerFixture) -> None:
encoder = OpenCLIPEncoder("ViT-B-32__openai", providers=["OpenVINOExecutionProvider", "CPUExecutionProvider"])

assert encoder.provider_options == [
{"device_type": "GPU_FP32"},
{"device_type": "GPU_FP32", "cache_dir": (encoder.cache_dir / "openvino").as_posix()},
{"arena_extend_strategy": "kSameAsRequested"},
]

Expand Down

0 comments on commit e8f0f82

Please sign in to comment.