类 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。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈