tritonclient-futures
特性
- 基于标准库concurrent与requests封装.
- 完整复现tritonclient,上手简单.
安装
pip install tritonclient-futures
示例
from tritonclient_futures import InferenceServerClient, InferInput, InferRequestedOutput, as_completed
# 客户端初始化
## url: tritonserver http url
## concurrency: 线程数
## pool_connections: 连接池个数
## pool_maxsize: 连接池的连接个数
client = InferenceServerClient(url='127.0.0.1:8000', concurrency=100, pool_connections=100, pool_maxsize=200)
# 同步调用
client.infer(model_name=model_name, inputs=inputs, outputs=outputs)
# 异步调用
fs = []
for i in iters:
fs.append(client.async_infer(model_name=i["model_name"], inputs=i["inputs"], outputs=i["outputs"]))
resps = [f.get_result() for f in as_completed(fs)]
性能
不如grpc,不如gevent/aioRelease files for tritonclient-futures 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tritonclient_futures-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / tritonclient_futures-0.9.0-py3-none-any.whl
| Download URL | tritonclient_futures-0.9.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a34a30a9c2b390096200b74e15ed4026546994992cf832914c6937b5f9233f3c
|
|
BLAKE2b-256 checksum How to use checksums |
9c8a65f189a3fc18cebb4838dadc034d96674b3d19a7f5b25a86d2dcd2a2f31b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|