Skip to content

Commit 89e1438

Browse files
[PyOV] Update Python API stub files (#32685)
- Updated Python API stub (.pyi) files from the latest available nightly Auto-generated by GitHub Actions
1 parent b56011e commit 89e1438

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/bindings/python/src/openvino/_ov_api.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ class Core(openvino._pyopenvino.Core):
296296
:rtype: openvino.CompiledModel
297297
298298
"""
299-
def import_model(self, model_stream: bytes, device_name: str, config: typing.Optional[dict[str, typing.Any]] = None) -> CompiledModel:
299+
def import_model(self, model_stream: typing.Union[bytes, _io.BytesIO, openvino._pyopenvino.Tensor], device_name: str, config: typing.Optional[dict[str, typing.Any]] = None) -> CompiledModel:
300300
"""
301301
Imports a compiled model from a previously exported one.
302302
303-
:param model_stream: Input stream, containing a model previously exported, using export_model method.
304-
:type model_stream: bytes
303+
:param model_stream: Input stream or tensor, containing a model previously exported, using export_model method.
304+
:type model_stream: Union[bytes, io.BytesIO, openvino.Tensor]
305305
:param device_name: Name of device to which compiled model is imported.
306306
Note: if device_name is not used to compile the original model,
307307
an exception is thrown.

src/bindings/python/src/openvino/_pyopenvino/__init__.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,24 @@ class Core:
766766
:return: Plugin version information.
767767
:rtype: dict[str, openvino.Version]
768768
"""
769+
@typing.overload
770+
def import_model(self, tensor: Tensor, device_name: str, properties: collections.abc.Mapping[str, typing.Any]) -> CompiledModel:
771+
"""
772+
Imports a compiled model from a previously exported one.
773+
774+
GIL is released while running this function.
775+
776+
:param compiled_blob: ov::Tensor input blob containing a model previously exported using the ov::CompiledModel::export_model method.
777+
:type compiled_blob: openvino.Tensor
778+
:param device_name: Name of device to which compiled model is imported.
779+
Note: if device_name is not used to compile the original model, an exception is thrown.
780+
:type device_name: str
781+
:param properties: Optional map of pairs: (property name, property value) relevant only for this load operation.
782+
:type properties: dict[str, typing.Any], optional
783+
:return: A compiled model.
784+
:rtype: openvino.CompiledModel
785+
"""
786+
@typing.overload
769787
def import_model(self, model_stream: typing.Any, device_name: str, properties: collections.abc.Mapping[str, typing.Any]) -> CompiledModel:
770788
"""
771789
Imports a compiled model from a previously exported one.

0 commit comments

Comments
 (0)