我有一个正在运行的torchserve服务。根据文档,我可以使用ManagementAPI在端口 8081 注册一个新模型。运行curl -X OPTIONS http://localhost:8081时,输出还说明发布请求的时间/models:
...
"post": {
"description": "Register a new model in TorchServe.",
"operationId": "registerModel",
"parameters": [
{
"in": "query",
"name": "url",
"description": "Model archive download url, support local file or HTTP(s) protocol. For S3, consider use pre-signed url.",
"required": true,
"schema": {
"type": "string"
}
},
...
现在,我确实有一个本地 model.mar 文件,并且想将它与文件协议一起使用。我试过了:
curl -X POST "http://localhost:8081/models?url=file:///path/to/model.mar"
但得到:
{
"code": 400,
"type": "DownloadArchiveException",
"message": "Failed to download archive from: file:///path/to/model.mar"
}
有什么我想念的吗?如何正确注册本地model.mar到正在运行的torchserve服务?