Skip to content

Commit 6492a65

Browse files
authored
Merge pull request #167 from georgian-io/fix-llm-qa
Fix LLM QA
2 parents 6a442a8 + e0da362 commit 6492a65

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

test_utils/test_config.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
InferenceConfig,
77
LoraConfig,
88
ModelConfig,
9+
QaConfig,
910
SftArgs,
1011
TrainingArgs,
1112
TrainingConfig,
@@ -70,4 +71,16 @@ def get_sample_config():
7071
test_size=0.1,
7172
train_test_split_seed=42,
7273
),
74+
qa=QaConfig(
75+
llm_tests=[
76+
"jaccard_similarity",
77+
"dot_product",
78+
"rouge_score",
79+
"word_overlap",
80+
"verb_percent",
81+
"adjective_percent",
82+
"noun_percent",
83+
"summary_length",
84+
]
85+
),
7386
)

tests/qa/test_generics.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def mock_rich_ui(mocker):
1212
@pytest.fixture
1313
def example_data():
1414
data = {
15-
"prompt": ["What is 2+2?", "What is the capital of France?"],
16-
"ground_truth": ["4", "Paris"],
17-
"model_prediction": ["3", "Paris"],
15+
"Prompt": ["What is 2+2?", "What is the capital of France?"],
16+
"Ground Truth": ["4", "Paris"],
17+
"Predicted": ["3", "Paris"],
1818
}
1919
return DataFrame(data)
2020

@@ -65,9 +65,7 @@ def test_save_test_results(mock_csv, mock_tests, mocker):
6565

6666
def test_print_test_results(capfd, example_data):
6767
tests = [MockQaTest()]
68-
test_suite = LLMTestSuite(
69-
tests, example_data["prompt"], example_data["ground_truth"], example_data["model_prediction"]
70-
)
68+
test_suite = LLMTestSuite(tests, example_data["Prompt"], example_data["Ground Truth"], example_data["Predicted"])
7169
test_suite.print_test_results()
7270
out, err = capfd.readouterr()
7371

0 commit comments

Comments
 (0)