在 Amazon SageMaker 上为我的模型设置终端节点后,我尝试使用 POST 请求调用它,该请求包含一个密钥image和内容类型为multipart/form-data.
我的 AWS CLI 命令是这样的:
aws sagemaker-runtime invoke-endpoint --endpoint-name <endpoint-name> --body image=@/local/file/path/dummy.jpg --content-type multipart/form-data output.json --region us-east-1
Run Code Online (Sandbox Code Playgroud)
这应该相当于:
curl -X POST -F "image=@/local/file/path/dummy.jpg" http://<endpoint>
Run Code Online (Sandbox Code Playgroud)
运行aws命令后,文件没有通过请求传输,我的模型正在接收没有任何文件的请求。
有人可以告诉我aws为了实现这一点,命令的正确格式应该是什么?