in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py [0:0]
def encode(content, accept_type=content_types.JSON):
"""
Encode an 🤗 Transformers object in a specific content_type.
"""
try:
encoder = _encoder_map[accept_type]
return encoder(content, accept_type)
except KeyError:
raise errors.UnsupportedFormatError(accept_type)