|
15 | 15 |
|
16 | 16 | def download_model(model_id, task, tmp_path): |
17 | 17 | 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], |
19 | 19 | capture_output=True, |
20 | 20 | text=True) |
21 | 21 | return MODEL_PATH |
22 | 22 |
|
23 | 23 |
|
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"): |
26 | 25 | shutil.rmtree(artifacts_path) |
27 | 26 |
|
28 | 27 |
|
@@ -84,7 +83,7 @@ def test_reranking_optimum(model_id, model_task, threshold, tmp_path): |
84 | 83 | similarity = get_similarity(outputs_optimum) |
85 | 84 | assert similarity >= threshold |
86 | 85 |
|
87 | | - remove_artifacts(outputs_path.as_posix()) |
| 86 | + remove_artifacts(outputs_path) |
88 | 87 |
|
89 | 88 | outputs_path = tmp_path / "genai" |
90 | 89 | # test GenAI |
@@ -127,5 +126,5 @@ def test_reranking_optimum(model_id, model_task, threshold, tmp_path): |
127 | 126 | "--genai" |
128 | 127 | ]) |
129 | 128 |
|
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