From 224aa5151d03c8c9a3ca5fd4ecb62292ec7c87d1 Mon Sep 17 00:00:00 2001 From: Ravidhu Date: Tue, 5 Dec 2023 01:28:29 +0100 Subject: [PATCH] Fix Sagemaker Endpoint documentation (#13660) - **Description:** fixed the transform_input method in the example., - **Issue:** example didn't work, - **Dependencies:** None, - **Tag maintainer:** @baskaryan, - **Twitter handle:** @Ravidhu87 --- docs/docs/integrations/llms/sagemaker.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/integrations/llms/sagemaker.ipynb b/docs/docs/integrations/llms/sagemaker.ipynb index f10e14d72e..101f9d81ab 100644 --- a/docs/docs/integrations/llms/sagemaker.ipynb +++ b/docs/docs/integrations/llms/sagemaker.ipynb @@ -141,7 +141,7 @@ " accepts = \"application/json\"\n", "\n", " def transform_input(self, prompt: str, model_kwargs: Dict) -> bytes:\n", - " input_str = json.dumps({prompt: prompt, **model_kwargs})\n", + " input_str = json.dumps({\"inputs\": prompt, \"parameters\": model_kwargs})\n", " return input_str.encode(\"utf-8\")\n", "\n", " def transform_output(self, output: bytes) -> str:\n", @@ -197,7 +197,7 @@ " accepts = \"application/json\"\n", "\n", " def transform_input(self, prompt: str, model_kwargs: Dict) -> bytes:\n", - " input_str = json.dumps({prompt: prompt, **model_kwargs})\n", + " input_str = json.dumps({\"inputs\": prompt, \"parameters\": model_kwargs})\n", " return input_str.encode(\"utf-8\")\n", "\n", " def transform_output(self, output: bytes) -> str:\n",