-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Py OV] Extend Model to utilize with-expressions #27191
Merged
mlukasze
merged 35 commits into
openvinotoolkit:master
from
almilosz:almilosz/model-context
Dec 20, 2024
Merged
[Py OV] Extend Model to utilize with-expressions #27191
mlukasze
merged 35 commits into
openvinotoolkit:master
from
almilosz:almilosz/model-context
Dec 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akuporos
reviewed
Oct 23, 2024
…into almilosz/model-context
Signed-off-by: Alicja Miloszewska <[email protected]>
This PR will be closed in a week because of 2 weeks of no activity. |
…openvino into almilosz/model-context
Signed-off-by: Alicja Miloszewska <[email protected]>
…openvino into almilosz/model-context
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
The test will check for both PermissionError and NoADirectoryError without python version distiction Signed-off-by: Alicja Miloszewska <[email protected]>
akuporos
reviewed
Dec 5, 2024
p-wysocki
reviewed
Dec 5, 2024
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
…into almilosz/model-context Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
…or messaging Signed-off-by: Alicja Miloszewska <[email protected]>
…into almilosz/model-context Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
p-wysocki
approved these changes
Dec 20, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Dec 20, 2024
11happy
pushed a commit
to 11happy/openvino
that referenced
this pull request
Dec 23, 2024
### Details: - Implement `__enter__` and `__exit__` to create class-based context manager - Remove inheritance from ModelBase in ie_api.Model and make it an attribute. - add private property __model that stores `_pyopenvino.Model`. In `_pyopenvino` such attribute can be accessed as `_Model__model` because of name mangling - update pyAPI methods that have `std::shared_ptr<ov::Model>` in their signatures. - add `test_model_with_statement` and `test_model_tempdir_fails` ### Motivation: On Windows reading `ov.Model` from temporary directory leads to `PermissionError`: ```python mem_model = generate_model_with_memory(input_shape=Shape([2, 1]), data_type=Type.f32) with tempfile.TemporaryDirectory() as model_save_dir: save_model(mem_model, f"{model_save_dir}/model.xml") model = Core().read_model(f"{model_save_dir}/model.xml") ``` ### Tickets: - CVS-106987 --------- Signed-off-by: Alicja Miloszewska <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details:
__enter__
and__exit__
to create class-based context manager_pyopenvino.Model
. In_pyopenvino
such attribute can be accessed as_Model__model
because of name manglingstd::shared_ptr<ov::Model>
in their signatures.test_model_with_statement
andtest_model_tempdir_fails
Motivation:
On Windows reading
ov.Model
from temporary directory leads toPermissionError
:Tickets: