Skip to content

Commit 367f606

Browse files
Support Multimodal datasets
1 parent 0890d35 commit 367f606

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tests/unit/test_files_checks.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,37 @@ def test_check_jsonl_invalid_weight(tmp_path: Path):
487487
assert "Weight must be either 0 or 1" in report["message"]
488488

489489

490+
def test_check_jsonl_invalid_multimodal_content(tmp_path: Path):
491+
file = tmp_path / "invalid_multimodal_content.jsonl"
492+
content = [
493+
{
494+
"messages": [
495+
{
496+
"role": "user",
497+
"content": [
498+
{"type": "text", "text": "Hello"},
499+
{
500+
"type": "image_url",
501+
"image_url": {"url": "<malformed_base64_image>"},
502+
},
503+
],
504+
},
505+
{
506+
"role": "assistant",
507+
"content": [{"type": "text", "text": "Hi there!"}],
508+
},
509+
]
510+
}
511+
]
512+
513+
with file.open("w") as f:
514+
f.write("\n".join(json.dumps(item) for item in content))
515+
516+
report = check_file(file)
517+
assert not report["is_check_passed"]
518+
assert "field must be either a JPEG, PNG or WEBP" in report["message"]
519+
520+
490521
def test_check_csv_valid_general(tmp_path: Path):
491522
# Create a valid CSV file
492523
file = tmp_path / "valid.csv"

0 commit comments

Comments
 (0)