Skip to content

Commit 6b18943

Browse files
committed
fixes
1 parent 8331259 commit 6b18943

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tools/who_what_benchmark/tests/test_cli_embeddings.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import pytest
44
import shutil
55
import logging
6+
from pathlib import Path
67
from test_cli_image import run_wwb, get_similarity
78

89

910
logging.basicConfig(level=logging.INFO)
1011
logger = logging.getLogger(__name__)
1112

1213

13-
def remove_artifacts(artifacts_path, file_type="outputs"):
14+
def remove_artifacts(artifacts_path: Path, file_type="outputs"):
1415
logger.info(f"Remove {file_type}")
1516
shutil.rmtree(artifacts_path)
1617

@@ -80,7 +81,7 @@ def test_embeddings_basic(model_id, model_type, tmp_path):
8081
similarity = get_similarity(outputs)
8182
assert similarity >= SIMILARITY_THRESHOLD
8283

83-
remove_artifacts(outputs_path.as_posix())
84+
remove_artifacts(outputs_path)
8485

8586
outputs_path = tmp_path / "genai"
8687
# test GenAI
@@ -124,5 +125,5 @@ def test_embeddings_basic(model_id, model_type, tmp_path):
124125
"--genai",
125126
])
126127

127-
remove_artifacts(outputs_path.as_posix())
128-
remove_artifacts(MODEL_PATH.as_posix(), "model")
128+
remove_artifacts(outputs_path)
129+
remove_artifacts(MODEL_PATH, "model")

tools/who_what_benchmark/tests/test_cli_reranking.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515

1616
def download_model(model_id, task, tmp_path):
1717
MODEL_PATH = Path(tmp_path, model_id.replace("/", "_"))
18-
subprocess.run(["optimum-cli", "export", "openvino", "--model", model_id, MODEL_PATH, "--task", task, "--trust-remote-code"],
18+
subprocess.run(["optimum-cli", "export", "openvino", "--model", model_id, MODEL_PATH, "--task", task],
1919
capture_output=True,
2020
text=True)
2121
return MODEL_PATH
2222

2323

24-
def remove_artifacts(artifacts_path, file_type="outputs"):
25-
logger.info(f"Remove {file_type}")
24+
def remove_artifacts(artifacts_path: Path, file_type="outputs"):
2625
shutil.rmtree(artifacts_path)
2726

2827

@@ -84,7 +83,7 @@ def test_reranking_optimum(model_id, model_task, threshold, tmp_path):
8483
similarity = get_similarity(outputs_optimum)
8584
assert similarity >= threshold
8685

87-
remove_artifacts(outputs_path.as_posix())
86+
remove_artifacts(outputs_path)
8887

8988
outputs_path = tmp_path / "genai"
9089
# test GenAI
@@ -127,5 +126,5 @@ def test_reranking_optimum(model_id, model_task, threshold, tmp_path):
127126
"--genai"
128127
])
129128

130-
remove_artifacts(outputs_path.as_posix())
131-
remove_artifacts(MODEL_PATH.as_posix(), "model")
129+
remove_artifacts(outputs_path)
130+
remove_artifacts(MODEL_PATH, "model")

0 commit comments

Comments
 (0)