Skip to content

Commit

Permalink
Fix compatibility with transformers (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Jan 19, 2024
1 parent 6d6e0f3 commit 3d4de05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def to(self, device: str):
Use the specified `device` for inference. For example: "cpu" or "gpu". `device` can
be in upper or lower case. To speed up first inference, call `.compile()` after `.to()`.
"""
self._device = device.upper()
self._device = str(device).upper()
self.request = None
return self

Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
**kwargs,
):
self._internal_dict = config
self._device = device.upper()
self._device = str(device).upper()
self.is_dynamic = dynamic_shapes
self.ov_config = ov_config if ov_config is not None else {}
self._model_save_dir = (
Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def __init__(
pass

def to(self, device: str):
self._device = device.upper()
self._device = str(device).upper()
self.encoder._device = self._device
self.decoder._device = self._device
if self.use_cache:
Expand Down

0 comments on commit 3d4de05

Please sign in to comment.