Skip to content

Commit

Permalink
UnknownExampleType Error Message display only keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanma-db committed May 30, 2024
1 parent fb9a225 commit 8e76bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llmfoundry/data/finetuning/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _get_example_type(example: Example) -> ExampleType:
):
return 'prompt_response'
else:
raise UnknownExampleTypeError(str(example.keys()))
raise UnknownExampleTypeError(str(list(example.keys())))


def _is_empty_or_nonexistent(dirpath: str) -> bool:
Expand Down
3 changes: 2 additions & 1 deletion tests/data/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,8 @@ def test_malformed_data(
if add_unknown_example_type:
error_context = pytest.raises(
UnknownExampleTypeError,
match=r'.*Unknown example type',
match=
r'\[("|\')(\w+)("|\')(?:,\s*("|\')(\w+)("|\'))*\].*Unknown example type',
)
if add_too_many_example_keys:
error_context = pytest.raises(
Expand Down

0 comments on commit 8e76bee

Please sign in to comment.