From b0a5d5804e8502f2246c868e494185657f1b968f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BB=D0=B0=D1=85=D0=BE=D0=B2=20=D0=90=D0=BB?= =?UTF-8?q?=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=9F=D0=B0=D0=B2=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Mon, 26 Aug 2024 09:32:11 +0000 Subject: [PATCH] add test for multimodal inference --- tests/cli/test_multimodal_inference.py | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/cli/test_multimodal_inference.py b/tests/cli/test_multimodal_inference.py index 91d1b0e..60c9a05 100644 --- a/tests/cli/test_multimodal_inference.py +++ b/tests/cli/test_multimodal_inference.py @@ -1,26 +1,26 @@ -# from pathlib import Path +from pathlib import Path -# import pytest -# from typer.testing import CliRunner +import pytest +from typer.testing import CliRunner -# from tests.constants import FIXTURES_PATH -# from turbo_alignment.cli import app -# from turbo_alignment.settings.pipelines.inference.multimodal import ( -# MultimodalInferenceExperimentSettings, -# ) +from tests.constants import FIXTURES_PATH +from turbo_alignment.cli import app +from turbo_alignment.settings.pipelines.inference.multimodal import ( + MultimodalInferenceExperimentSettings, +) -# runner = CliRunner() +runner = CliRunner() -# @pytest.mark.parametrize( -# 'config_path', -# [ -# FIXTURES_PATH / 'configs/inference/multimodal/llama_llava_clip_pickle.json', -# ], -# ) -# def test_multimodal_inference_mlp_with_preprocessing(config_path: Path): -# result = runner.invoke( -# app, ['inference_multimodal', '--inference_settings_path', str(config_path)], catch_exceptions=False -# ) -# assert result.exit_code == 0 -# assert MultimodalInferenceExperimentSettings.parse_file(config_path).save_path.is_dir() +@pytest.mark.parametrize( + 'config_path', + [ + FIXTURES_PATH / 'configs/inference/multimodal/llama_llava_clip_pickle.json', + ], +) +def test_multimodal_inference_mlp_with_preprocessing(config_path: Path): + result = runner.invoke( + app, ['inference_multimodal', '--inference_settings_path', str(config_path)], catch_exceptions=False + ) + assert result.exit_code == 0 + assert MultimodalInferenceExperimentSettings.parse_file(config_path).save_path.is_dir()