Skip to content

Commit d64c8d4

Browse files
authored
[Py OV] Update samples to use __version__ instead of get_version() (openvinotoolkit#28717)
### Details: - Change `get_version()` to `__version__` - Discussed [here](openvinotoolkit#28341 (comment)) ### Tickets: - [CVS-160332](https://jira.devtools.intel.com/browse/CVS-160332) --------- Signed-off-by: Alicja Miloszewska <alicja.miloszewska@intel.com>
1 parent 6a8a65f commit d64c8d4

File tree

6 files changed

+6
-9
lines changed

6 files changed

+6
-9
lines changed

samples/python/benchmark/bert_benchmark/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following Python API is used in the application:
1212

1313
| Feature | API | Description |
1414
| -------------------------| ------------------------------------------------|----------------------------------------------|
15-
| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
15+
| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
1616
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model. |
1717
| | [openvino.runtime.Core.compile_model] | |
1818
| Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. |

samples/python/benchmark/bert_benchmark/bert_benchmark.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import openvino as ov
1313
import datasets
14-
from openvino import get_version
1514
from transformers import AutoTokenizer
1615
from transformers.onnx import export
1716
from transformers.onnx.features import FeaturesManager
@@ -20,7 +19,7 @@
2019
def main():
2120
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
2221
log.info('OpenVINO:')
23-
log.info(f"{'Build ':.<39} {get_version()}")
22+
log.info(f"{'Build ':.<39} {ov.__version__}")
2423
model_name = 'bert-base-uncased'
2524
# Download the model
2625
transformers_model = FeaturesManager.get_model_from_feature('default', model_name)

samples/python/benchmark/sync_benchmark/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following Python API is used in the application:
1919

2020
| Feature | API | Description |
2121
| --------------------------| ------------------------------------------------|----------------------------------------------|
22-
| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
22+
| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
2323
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, |
2424
| | [openvino.runtime.Core.compile_model], | configure input tensors. |
2525
| | [openvino.runtime.InferRequest.get_tensor] | |

samples/python/benchmark/sync_benchmark/sync_benchmark.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import numpy as np
1212
import openvino as ov
13-
from openvino import get_version
1413
from openvino.utils.types import get_dtype
1514

1615

@@ -29,7 +28,7 @@ def fill_tensor_random(tensor):
2928
def main():
3029
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
3130
log.info('OpenVINO:')
32-
log.info(f"{'Build ':.<39} {get_version()}")
31+
log.info(f"{'Build ':.<39} {ov.__version__}")
3332
device_name = 'CPU'
3433
if len(sys.argv) == 3:
3534
device_name = sys.argv[2]

samples/python/benchmark/throughput_benchmark/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following Python API is used in the application:
2121

2222
| Feature | API | Description |
2323
| --------------------------| ------------------------------------------------|----------------------------------------------|
24-
| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. |
24+
| OpenVINO API Version | [openvino.\_\_version__] | Get Openvino API version. |
2525
| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, |
2626
| | [openvino.runtime.Core.compile_model] | configure input tensors. |
2727
| | [openvino.runtime.InferRequest.get_tensor] | |

samples/python/benchmark/throughput_benchmark/throughput_benchmark.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import numpy as np
1212
import openvino as ov
13-
from openvino import get_version
1413
from openvino.utils.types import get_dtype
1514

1615

@@ -29,7 +28,7 @@ def fill_tensor_random(tensor):
2928
def main():
3029
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
3130
log.info('OpenVINO:')
32-
log.info(f"{'Build ':.<39} {get_version()}")
31+
log.info(f"{'Build ':.<39} {ov.__version__}")
3332
device_name = 'CPU'
3433
if len(sys.argv) == 3:
3534
device_name = sys.argv[2]

0 commit comments

Comments
 (0)