Skip to content

Commit

Permalink
[Py OV] Update samples to use __version__ instead of get_version() (#…
Browse files Browse the repository at this point in the history
…28717)

### Details:
 - Change `get_version()` to `__version__`
- Discussed
[here](#28341 (comment))


### Tickets:
 - [CVS-160332](https://jira.devtools.intel.com/browse/CVS-160332)

---------

Signed-off-by: Alicja Miloszewska <[email protected]>
  • Loading branch information
almilosz authored Jan 29, 2025
1 parent 6a8a65f commit d64c8d4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion samples/python/benchmark/bert_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
3 changes: 1 addition & 2 deletions samples/python/benchmark/bert_benchmark/bert_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

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
Expand All @@ -20,7 +19,7 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion samples/python/benchmark/sync_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] | |
Expand Down
3 changes: 1 addition & 2 deletions samples/python/benchmark/sync_benchmark/sync_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import numpy as np
import openvino as ov
from openvino import get_version
from openvino.utils.types import get_dtype


Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion samples/python/benchmark/throughput_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import numpy as np
import openvino as ov
from openvino import get_version
from openvino.utils.types import get_dtype


Expand All @@ -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]
Expand Down

0 comments on commit d64c8d4

Please sign in to comment.