OnnxLLM
This is an example project for learning purpose
Installation
Using Prebuilt
pip install onnxllm
Install From Source
pip install git+https://github.com/inisis/OnnxLLM@main
Install From Local
git clone https://github.com/inisis/OnnxLLM && cd OnnxLLM/
pip install .
How to use
from transformers import AutoTokenizer
from onnxllm import AutoModelForCausalLM
# you should download onnx models from https://huggingface.co/inisis-me first
tokenizer = AutoTokenizer.from_pretrained("/data/llm/llm-export/onnx-standard/", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("/data/llm/llm-export/onnx-standard/", trust_remote_code=True)
prompt = '蒙古国的首都是乌兰巴托(Ulaanbaatar)\n冰岛的首都是雷克雅未克(Reykjavik)\n埃塞俄比亚的首都是'
inputs = tokenizer(prompt, return_tensors='pt')
output = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(output[0], skip_special_tokens=True))
References
Metadata
Release files for onnxllm 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onnxllm-0.0.1.tar.gz | 9.3 kB | Without provenance | Details for onnxllm-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onnxllm-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for onnxllm-0.0.1-py3-none-any.whl |
Total release size: 22.0 kB
Release files / onnxllm-0.0.1.tar.gz
| Download URL | onnxllm-0.0.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b158c2c9fbc496517e9ca12bac8813267165bcf593f1d0de1ac12bd61b2f3a3e
|
|
BLAKE2b-256 checksum How to use checksums |
b9228d4c638ada20206f7bf3c0772d0ae704123189244ac45e22080b5f040a38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / onnxllm-0.0.1-py3-none-any.whl
| Download URL | onnxllm-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68fce3a120448b059dade4e57b149026156b99932d8c8f77114f79ad0644e759
|
|
BLAKE2b-256 checksum How to use checksums |
ed0eabfda5b08b0d2d897258608b54aed13ef8c8af9c7c5e7daec9de9fa87162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Security for onnxllm 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.