litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug] Sagemaker Embedding endpoint exception with text_inputs key

Open gauravnbcu opened this issue 2 years ago • 8 comments

This causes Exception https://github.com/BerriAI/litellm/blob/cace0bd6fbd77e3abf4723db7c1d459c90e5abe2/litellm/llms/sagemaker.py#L593

{ "error": { "message": "Received client error (400) from primary with message \"{\n \"code\": 400,\n \"type\": \"InternalServerException\",\n \"message\": \"text input must be of type str(single example),List[str](batch or single pretokenized example) orList[List[str]] (batch of pretokenized examples).\"\n}\n\". See https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logEventViewer:group=/aws/sagemaker/Endpoints/hf-bge-large-en-v15 in account <> for more information.", "type": null, "param": null, "code": 500 } }

Should be changed to data = json.dumps({"inputs": input}).encode("utf-8")

gauravnbcu avatar Mar 20 '24 20:03 gauravnbcu

@gauravnbcu can I see how you're making the call to litellm ?

ishaan-jaff avatar Mar 20 '24 20:03 ishaan-jaff

Through Postman POST call for /v1/embeddings with following body { "model":"bge-embedding-large", "input":"this is a test sentence" }

gauravnbcu avatar Mar 20 '24 20:03 gauravnbcu

@gauravnbcu can we live debug this together ? Want to make sure I understand the issue: I'm on here if you're free: https://meet.google.com/psj-bgtf-uba

Sharing a link to my cal for your convenience: https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version?month=2023-10

ishaan-jaff avatar Mar 20 '24 21:03 ishaan-jaff

Sure, We can meet at 3pm EST or earlier, let me know your availability

gauravnbcu avatar Mar 21 '24 14:03 gauravnbcu

@gauravnbcu what's the best email to send an invite to? You can DM on Linkedin if you prefer: https://www.linkedin.com/in/reffajnaahsi/

ishaan-jaff avatar Mar 21 '24 14:03 ishaan-jaff

@ishaan-jaff Can we use https://meet.google.com/psj-bgtf-uba now ?

gauravnbcu avatar Mar 21 '24 15:03 gauravnbcu

@gauravnbcu I scheduled a meeting for 3pm EST / 12pm PT here https://calendar.app.google/6fZ7aEBgYkiuH21n6

ishaan-jaff avatar Mar 21 '24 16:03 ishaan-jaff

@ishaan-jaff Are you guys on planning to fix this or not

gauravnbcu avatar Apr 16 '24 16:04 gauravnbcu