Skip to main content

onnxruntime_transformers

transformers for production runtime, 3x faster on cpu, no pytorch nor tensorflow included

convert models to onnx

install converter pip install optimum[exporters]

convert embedding model to onnx

optimum-cli export onnx --task sentence-similarity --model "infgrad/stella-base-zh-v3-1792d" bert_embed

convert sentence correction model to onnx

optimum-cli export onnx --task fill-mask --model "shibing624/macbert4csc-base-chinese" bert_csc

convert ner model to onnx

optimum-cli export onnx --task token-classification --model "shibing624/bert4ner-base-chinese" bert_ner

inference with onnx

generate embeddings

from onnxruntime_transformers import OnnxruntimeTransformers
encoder = OnnxruntimeTransformers("./bert_embed/tokenizer.json", "./bert_embed/model.onnx")
embeddings = encoder.encode([
    "how are you",
    "I'm fine thank you, and you?",
])

Release files for onnxruntime-transformers 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onnxruntime-transformers 0.1.5
File Size Uploaded
onnxruntime_transformers-0.1.5.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onnxruntime-transformers 0.1.5
File Interpreter ABI Platform
onnxruntime_transformers-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / onnxruntime_transformers-0.1.5.tar.gz

Download URL onnxruntime_transformers-0.1.5.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8511ee1893ec972d24e9674b75bb5cef1826b5d09c739caef3413bbad5ba443c
BLAKE2b-256 checksum
How to use checksums
57b0656a4b198f4755bc8afb3fd12e16a8843c1866a5b7952d8c53d5bf648848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / onnxruntime_transformers-0.1.5-py3-none-any.whl

Download URL onnxruntime_transformers-0.1.5-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a06d72d54e02dfe8ba6de1eacb6c5002a0a0731295c60b90072a42c7335a4592
BLAKE2b-256 checksum
How to use checksums
75e0cfcc7f485f619e44209459bf95906d01db95f9729377889485bd0d6aa2ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page