跳转到主要内容

机器学习模型

项目描述

Modelz Python SDK

pip install modelz-py

CLI

modelz --help

稳定扩散

echo "cute cat" | modelz inference $PROJECT --serde msgpack --write-file cat.jpg --read-stdin

Modelz端点上的Gradio客户端

我们提供了一个轻量级的Python库,使得将任何在modelz上提供的Gradio应用作为API使用变得非常简单。GradioClient的功能与Gradio提供的gradio_client库中的Client完全相同。唯一的区别是在初始化客户端时,应输入您的Modelz服务端点URL而不是Hugging Face space。

示例用法

from modelz import GradioClient as Client

# Parameter here is the endpoint of your Modelz deployment
# The format is like https://${DEPOLOYMENT_KEY}.modelz.io/
cli = Client("https://translator-th85ze61tj4n3klc.modelz.io/")

cli.view_api() 
# >> Client.predict() Usage Info
# ---------------------------
# Named API endpoints: 1

#  - predict(text, api_name="/predict") -> output
#     Parameters:
#      - [Textbox] text: str 
#     Returns:
#      - [Textbox] output: str 

      
cli.predict("hallo", api_name="/predict")
# >> "Bonjour."

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源分布

modelz-py-0.3.3.tar.gz (10.2 kB 查看哈希值)

上传时间

构建分布

modelz_py-0.3.3-py3-none-any.whl (11.3 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面