Skip to content

Commit c71a4c5

Browse files
committed
fix: avoid returning none as a serializer
return an error instead Signed-off-by: Raphael Glon <[email protected]>
1 parent 8706049 commit c71a4c5

File tree

1 file changed

+6
-0
lines changed
  • src/huggingface_inference_toolkit/serialization

1 file changed

+6
-0
lines changed

src/huggingface_inference_toolkit/serialization/base.py

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def get_deserializer(content_type: str, task: str):
4444
return Audioer
4545
elif "image" in task:
4646
return Imager
47+
message = f"""
48+
Content type "{content_type}" not supported for task {task}.
49+
Supported content types are:
50+
{", ".join(list(content_type_mapping.keys()))}
51+
"""
52+
raise Exception(message)
4753

4854
# Extract media type from content type
4955
extracted = content_type.split(";")[0]

0 commit comments

Comments
 (0)