Skip to content

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

[Py OV] Update samples to use __version__ instead of get_version() (#28717)

Alicja Miloszewskad64c8d476b2d
diff --git a/samples/python/benchmark/bert_benchmark/README.md b/samples/python/benchmark/bert_benchmark/README.md
index 2894c5f33d6..423ba9b9188 100644
--- a/samples/python/benchmark/bert_benchmark/README.md
+++ b/samples/python/benchmark/bert_benchmark/README.md
@@ -12,7 +12,7 @@ The following Python API is used in the application:
| Feature | API | Description |
| -------------------------| ------------------------------------------------|----------------------------------------------|
-| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
+| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model. |
| | [openvino.runtime.Core.compile_model] | |
| Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. |
diff --git a/samples/python/benchmark/bert_benchmark/bert_benchmark.py b/samples/python/benchmark/bert_benchmark/bert_benchmark.py
index bd59c2bd2b3..30770472960 100755
--- a/samples/python/benchmark/bert_benchmark/bert_benchmark.py
+++ b/samples/python/benchmark/bert_benchmark/bert_benchmark.py
@@ -11,7 +11,6 @@ from time import perf_counter
import openvino as ov
import datasets
-from openvino import get_version
from transformers import AutoTokenizer
from transformers.onnx import export
from transformers.onnx.features import FeaturesManager
@@ -20,7 +19,7 @@ from transformers.onnx.features import FeaturesManager
def main():
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
log.info('OpenVINO:')
- log.info(f"{'Build ':.<39} {get_version()}")
+ log.info(f"{'Build ':.<39} {ov.__version__}")
model_name = 'bert-base-uncased'
# Download the model
transformers_model = FeaturesManager.get_model_from_feature('default', model_name)
diff --git a/samples/python/benchmark/sync_benchmark/README.md b/samples/python/benchmark/sync_benchmark/README.md
index c7604386625..e620ca60512 100644
--- a/samples/python/benchmark/sync_benchmark/README.md
+++ b/samples/python/benchmark/sync_benchmark/README.md
@@ -19,7 +19,7 @@ The following Python API is used in the application:
| Feature | API | Description |
| --------------------------| ------------------------------------------------|----------------------------------------------|
-| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
+| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, |
| | [openvino.runtime.Core.compile_model], | configure input tensors. |
| | [openvino.runtime.InferRequest.get_tensor] | |
diff --git a/samples/python/benchmark/sync_benchmark/sync_benchmark.py b/samples/python/benchmark/sync_benchmark/sync_benchmark.py
index db877b7238f..0fcf71c56cc 100755
--- a/samples/python/benchmark/sync_benchmark/sync_benchmark.py
+++ b/samples/python/benchmark/sync_benchmark/sync_benchmark.py
@@ -10,7 +10,6 @@ from time import perf_counter
import numpy as np
import openvino as ov
-from openvino import get_version
from openvino.utils.types import get_dtype
@@ -29,7 +28,7 @@ def fill_tensor_random(tensor):
def main():
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
log.info('OpenVINO:')
- log.info(f"{'Build ':.<39} {get_version()}")
+ log.info(f"{'Build ':.<39} {ov.__version__}")
device_name = 'CPU'
if len(sys.argv) == 3:
device_name = sys.argv[2]
diff --git a/samples/python/benchmark/throughput_benchmark/README.md b/samples/python/benchmark/throughput_benchmark/README.md
index 5214c1190bb..dea73615570 100644
--- a/samples/python/benchmark/throughput_benchmark/README.md
+++ b/samples/python/benchmark/throughput_benchmark/README.md
@@ -21,7 +21,7 @@ The following Python API is used in the application:
| Feature | API | Description |
| --------------------------| ------------------------------------------------|----------------------------------------------|
-| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
+| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, |
| | [openvino.runtime.Core.compile_model] | configure input tensors. |
| | [openvino.runtime.InferRequest.get_tensor] | |
diff --git a/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py b/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py
index c96179d74ed..b5c5b105c85 100755
--- a/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py
+++ b/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py
@@ -10,7 +10,6 @@ from time import perf_counter
import numpy as np
import openvino as ov
-from openvino import get_version
from openvino.utils.types import get_dtype
@@ -29,7 +28,7 @@ def fill_tensor_random(tensor):
def main():
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
log.info('OpenVINO:')
- log.info(f"{'Build ':.<39} {get_version()}")
+ log.info(f"{'Build ':.<39} {ov.__version__}")
device_name = 'CPU'
if len(sys.argv) == 3:
device_name = sys.argv[2]