-
Notifications
You must be signed in to change notification settings - Fork 293
[CI] [GHA] Use OV_CACHE in the WWB tests
#2781
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
Open
akashchi
wants to merge
27
commits into
openvinotoolkit:master
Choose a base branch
from
akashchi:ci/gha/ov-cache-wwb
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−35
Open
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6495cfd
add WWB cache dir
akashchi 29a668c
fix lint, use cache for vlm test
akashchi 229ef95
use caches in other tests
akashchi dd2140f
create if not existing
akashchi 2bc0ada
lint
akashchi 72ab81a
use cache for datasets
akashchi a6028ee
Revert "use cache for datasets"
akashchi ffbafd1
verbosity
akashchi 57916ca
use cache for ov models only
akashchi 01a91ed
lint
akashchi 916d33d
merge
akashchi 2dcc9ba
rm unused
akashchi 19e5943
quotes, reuse cache dir setting logic
akashchi 31bc592
use path to hf model
akashchi f8f7437
Apply suggestions from code review
akashchi 42d1eb0
Update tools/who_what_benchmark/tests/test_cli_vlm.py
as-suvorov e305656
Merge branch 'master' into ci/gha/ov-cache-wwb
as-suvorov 0470bf1
Merge branch 'master' into ci/gha/ov-cache-wwb
akashchi 404461e
Merge branch 'master' into ci/gha/ov-cache-wwb
as-suvorov 464d2f9
rm cache dir
akashchi 9dfa38b
Merge remote-tracking branch 'upstream/master' into ci/gha/ov-cache-wwb
akashchi a8d0882
Merge branch 'ci/gha/ov-cache-wwb' of https://github.com/akashchi/ope…
akashchi a6d802a
merge
akashchi 9c55669
Merge remote-tracking branch 'upstream/master' into ci/gha/ov-cache-wwb
akashchi af17000
save tokenizer to a separate folder
akashchi cb3ad5f
do not use save pretrained
akashchi 6674ebf
export tokenizer
akashchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from pathlib import Path | ||
| import os | ||
| import tempfile | ||
|
|
||
|
|
||
| WWB_CACHE_PATH = Path(os.path.join(os.environ.get('OV_CACHE', tempfile.TemporaryDirectory()), 'wwb_cache')) | ||
akashchi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| SHOULD_CLEANUP = bool(os.environ.get('CLEANUP_CACHE', None)) | ||
akashchi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,13 @@ | |
| import logging | ||
| import tempfile | ||
| import re | ||
| from constants import WWB_CACHE_PATH, SHOULD_CLEANUP | ||
|
|
||
|
|
||
| logging.basicConfig(level=logging.INFO) | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
| MODEL_CACHE = tempfile.mkdtemp() | ||
| MODEL_CACHE = WWB_CACHE_PATH | ||
| OV_IMAGE_MODELS = ["echarlaix/tiny-random-stable-diffusion-xl", | ||
| "yujiepan/stable-diffusion-3-tiny-random", | ||
| "katuni4ka/tiny-random-flux", | ||
|
|
@@ -42,8 +43,9 @@ def setup_module(): | |
|
|
||
|
|
||
| def teardown_module(): | ||
| logger.info("Remove models") | ||
| shutil.rmtree(MODEL_CACHE) | ||
| if SHOULD_CLEANUP: | ||
| logger.info("Removing models") | ||
| shutil.rmtree(MODEL_CACHE) | ||
|
|
||
|
|
||
| def get_similarity(output: str) -> float: | ||
|
|
@@ -67,11 +69,12 @@ def get_similarity(output: str) -> float: | |
| ], | ||
| ) | ||
| def test_image_model_types(model_id, model_type, backend, tmp_path): | ||
| MODEL_PATH = os.path.join(MODEL_CACHE, model_id.replace("/", "--")) | ||
|
||
| wwb_args = [ | ||
| "--base-model", | ||
| model_id, | ||
| MODEL_PATH, | ||
| "--target-model", | ||
| model_id, | ||
| MODEL_PATH, | ||
| "--num-samples", | ||
| "1", | ||
| "--gt-data", | ||
|
|
@@ -195,9 +198,10 @@ def test_image_model_genai(model_id, model_type, tmp_path): | |
| ) | ||
| def test_image_custom_dataset(model_id, model_type, backend, tmp_path): | ||
| GT_FILE = tmp_path / "test_sd.csv" | ||
| MODEL_PATH = os.path.join(MODEL_CACHE, model_id.replace("/", "--")) | ||
|
||
| wwb_args = [ | ||
| "--base-model", | ||
| model_id, | ||
| MODEL_PATH, | ||
| "--num-samples", | ||
| "1", | ||
| "--gt-data", | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a
conftest.py.should_cleanupandwwb_cache_pathcould be session fixtures.