Skip to content

Commit 8927cd8

Browse files
committed
Change check for gpu device
1 parent 52445f4 commit 8927cd8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

optimum/intel/openvino/modeling_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def compile(self):
349349
if (
350350
"CACHE_DIR" not in self.ov_config.keys()
351351
and not str(self.model_save_dir).startswith(gettempdir())
352-
and self._device.lower().split(":")[0] == "gpu"
352+
and "gpu" in self._device.lower()
353353
):
354354
# Set default CACHE_DIR only if it is not set, if the model is not in a temporary directory, and device is GPU
355355
cache_dir = Path(self.model_save_dir).joinpath("model_cache")

optimum/intel/openvino/modeling_seq2seq.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def _compile(self):
568568
if (
569569
"CACHE_DIR" not in ov_config.keys()
570570
and not str(self.parent_model.model_save_dir).startswith(gettempdir())
571-
and self._device.lower().startswith("gpu")
571+
and "gpu" in self._device.lower()
572572
):
573573
cache_dir = Path(self.parent_model.model_save_dir).joinpath("model_cache")
574574
ov_config["CACHE_DIR"] = str(cache_dir)

0 commit comments

Comments
 (0)