Skip to content

Commit 4673dcb

Browse files
committed
Explicit error message when no content-type is provided
Signed-off-by: Raphael Glon <[email protected]>
1 parent 963f728 commit 4673dcb

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

src/huggingface_inference_toolkit/serialization/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
class ContentType:
3838
@staticmethod
3939
def get_deserializer(content_type: str, task: str):
40+
if not content_type:
41+
message = f"No content type provided and no default one configured."
42+
raise Exception(message)
4043
if content_type.lower().startswith("application/octet-stream"):
4144
if "audio" in task or "speech" in task:
4245
return Audioer

0 commit comments

Comments
 (0)