工作流推理 API¶
工作流推理 API 默认监听 8080 端口,并且只能从本地主机访问。要更改默认设置,请参阅 TorchServe 配置。
TorchServe 服务器支持以下 API
预测 API - 从已服务的模型获取预测
预测 API¶
要从工作流获取预测,请向 /wfpredict/{workflow_name}
发出 REST 调用
POST /wfpredict/{workflow_name}
curl 示例¶
curl -O https://raw.githubusercontent.com/pytorch/serve/master/docs/images/kitten_small.jpg
curl https://127.0.0.1:8080/wfpredict/myworkflow -T kitten_small.jpg
结果是 JSON 对象,返回来自工作流 DAG 叶节点的响应字节。