Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[PyOV] Update Python API stub files (#35631)

sys-openvino-ci83c4ca216787
diff --git a/src/bindings/python/src/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.pyi b/src/bindings/python/src/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.pyi
index 4b7aadd3ff4..b7b6c9a096e 100644
--- a/src/bindings/python/src/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.pyi
+++ b/src/bindings/python/src/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.pyi
@@ -27,6 +27,15 @@ def _build_dynamic_shapes(inputs, input_specs = None):
flatten inputs, pair each leaf with its spec, and then unflatten the
result back into the original structure that torch.export expects.
+ """
+def _is_pytorch_zip(path):
+ """
+ Check if a file looks like a PyTorch archive (TorchScript or ExportedProgram).
+
+ Both formats are ZIP archives with specific internal entries.
+ This lightweight check avoids expensive torch.jit.load / torch.export.load
+ calls (and their warnings/side effects) on non-PyTorch files.
+
"""
def extract_input_info_from_example(args, inputs):
...