From 8a9fc8816fc331ef81734f36dc82ae83e8240722 Mon Sep 17 00:00:00 2001 From: duk-amz <94886526+duk-amz@users.noreply.github.com> Date: Sat, 27 Aug 2022 07:36:44 +1000 Subject: [PATCH] Updated the serialisation function for CSV Fixed string formatting issue for inference --- .../train register and deploy a pipeline model.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sagemaker-pipelines/tabular/train-register-deploy-pipeline-model/train register and deploy a pipeline model.ipynb b/sagemaker-pipelines/tabular/train-register-deploy-pipeline-model/train register and deploy a pipeline model.ipynb index 2fbf96183d..2b7f52f0ef 100644 --- a/sagemaker-pipelines/tabular/train-register-deploy-pipeline-model/train register and deploy a pipeline model.ipynb +++ b/sagemaker-pipelines/tabular/train-register-deploy-pipeline-model/train register and deploy a pipeline model.ipynb @@ -1130,7 +1130,7 @@ "data = data.drop(\"medianHouseValue\", axis=1)\n", "\n", "pred_count = 10\n", - "payload = data.iloc[:pred_count].to_string(header=False, index=False).replace(\" \", \",\")\n", + "payload = data.iloc[:pred_count].to_csv(header=False, index=False)\n", "p = predictor.predict(payload, initial_args={\"ContentType\": \"text/csv\"})\n", "print(p.decode(\"utf-8\"))" ] @@ -1231,4 +1231,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +}