工作流推理 API¶
Workflow Inference API 正在侦听端口 8080,默认情况下只能从 localhost 访问。要更改默认设置,请参阅 TorchServe 配置。
TorchServe器支持以下 API:
预测 API - 从提供的模型获取预测
预测 API¶
要从工作流获取预测,请对 :/wfpredict/{workflow_name}
POST /wfpredict/{workflow_name}
curl 示例¶
curl -O https://raw.githubusercontent.com/pytorch/serve/master/docs/images/kitten_small.jpg
curl http://localhost:8080/wfpredict/myworkflow -T kitten_small.jpg
结果是 JSON 对象,从工作流 DAG 的叶节点返回响应字节。