类 DeployClient

azureml.deploy.DeployClient(host, auth=None, use=None)

定义用于创建部署客户端的工厂。

具有 use 属性的基本用法模块实现插件:

从导入引用查找并加载模块:

from azureml.deploy import DeployClient
from azureml.deploy.server import MLServer

host = 'http://localhost:12800'
ctx = ('username', 'password')
mls_client = DeployClient(host, use=MLServer, auth=ctx)

从命名空间 str 查找并加载由 use 定义的模块:

host = 'http://localhost:12800'
ctx = ('username', 'password')

mls_client = DeployClient(host, use=MLServer, auth=ctx)
mls_client = DeployClient(host, use='azureml.deploy.server.MLServer',
auth=ctx)

从文件/路径元组查找并加载模块:

host = 'http://localhost:12800'
ctx = ('username', 'password')

use = ('azureml.deploy.server.MLServer', '/path/to/mlserver.py')
mls_client = DeployClient(host, use=use, auth=ctx)

创建新部署客户端。

参数

host

服务器 HTTP/HTTPS 终结点,包括端口号。

auth

(可选)身份验证上下文。 并非所有部署客户端都需要身份验证。 auth 对于 MLServer 是必需的

use

(必需)部署实现以使用 (ex) use='MLServer' 来使用 ML Server。