Skip to content

Commit

Permalink
remove superfluous test case
Browse files Browse the repository at this point in the history
  • Loading branch information
alextrott16 committed Apr 11, 2024
1 parent 0f00165 commit e5d7e3f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/data/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,15 +1095,20 @@ def test_build_unknown_dataloader():
_ = build_dataloader(cfg, tokenizer, 2)


invalid_conversation_params_sharegpt = [
'add_invalid_last_chat_message', 'add_invalid_content_type',
'add_invalid_role', 'add_not_alternating_roles'
]


@pytest.mark.parametrize(
','.join(invalid_conversation_params),
generate_exclusive_test_params(invalid_conversation_params))
','.join(invalid_conversation_params_sharegpt),
generate_exclusive_test_params(invalid_conversation_params_sharegpt))
def test_sharegpt_format(tmp_path: pathlib.Path,
add_invalid_last_chat_message: bool,
add_invalid_message_key_quantity: bool,
add_invalid_content_type: bool, add_invalid_role: bool,
add_not_alternating_roles: bool):
tokenizer_name = 'mosaicml/mpt-30b-chat'
tokenizer_name = 'mosaicml/mpt-7b'
max_seq_len = 2048
dataset_size = 5
device_batch_size = 5
Expand All @@ -1125,7 +1130,7 @@ def test_sharegpt_format(tmp_path: pathlib.Path,
path=tiny_dataset_path,
size=dataset_size,
add_invalid_last_chat_message=add_invalid_last_chat_message,
add_invalid_message_key_quantity=add_invalid_message_key_quantity,
add_invalid_message_key_quantity=False,
add_invalid_content_type=add_invalid_content_type,
add_invalid_role=add_invalid_role,
add_not_alternating_roles=add_not_alternating_roles,
Expand Down Expand Up @@ -1158,9 +1163,6 @@ def test_sharegpt_format(tmp_path: pathlib.Path,
if add_invalid_last_chat_message:
error_context = pytest.raises(InvalidLastChatMessageRoleError,
match='Invalid last message role:')
if add_invalid_message_key_quantity:
error_context = pytest.raises(IncorrectMessageKeyQuantityError,
match='Expected 2 keys in message')
if add_invalid_content_type:
error_context = pytest.raises(InvalidContentTypeError,
match='Expected content to be')
Expand Down

0 comments on commit e5d7e3f

Please sign in to comment.