Skip to content

Commit c9aeab3

Browse files
committed
apply lint
1 parent 92b9fa6 commit c9aeab3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

flexeval/core/multiple_choice_dataset/template_based.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def __getitem__(self, i: int) -> MultipleChoiceInstance:
7777
choices = [" " + c for c in choices]
7878

7979
answer_index = int(self.answer_index_template.render(**item))
80-
if not (0 <= answer_index and answer_index < len(choices)):
81-
msg = f"at least {answer_idx+1} choices required, but got {choices}"
80+
if not (answer_index >= 0 and answer_index < len(choices)):
81+
msg = f"at least {answer_index+1} choices required, but got {choices}"
8282
raise ValueError(msg)
8383

8484
return MultipleChoiceInstance(

tests/core/multiple_choice_dataset/test_template_based.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_template_multiple_choice_dataset(
7373
"test_additional_input": "additional: Who wrote 'Romeo and Juliet'?",
7474
}
7575

76+
7677
@pytest.mark.parametrize(
7778
("dataset_class", "kwargs"),
7879
DATASETS_TO_TEST,

0 commit comments

Comments
 (0)