quantizetk
Project description
QuantizeTK
QuantizeTK is a Python library that provides a set of utilities for model optimization and quantization. It simplifies the process of loading optimized and quantized models using OnnxRuntime, along with pre-trained base models. The library is built on top of transformers and optimum.
Installation
pip install quantizetk
Features
- Load optimized, quantized, or base pipelines
- Supports models in the OnnxRuntime ecosystem
- Comprehensive logging and validation utilities
- Configurable optimization and quantization settings
Quick Start
Initialize a New Pipeline
from quantizetk import init_pipeline
pipeline = init_pipeline(model_id="your_model_id")
Load an Existing Pipeline
from quantizetk.pipeline.load import load_pipeline
pipeline = load_pipeline()
Directory Structure
quantizetk/
│
├── pipeline/
│ ├── create.py
│ ├── load.py
│ └── __init__.py
│
├── shared/
│ ├── constants.py
│ ├── utils/
│ │ ├── validate.py
│ │ └── math_util.py
│ └── __init__.py
│
└── __init__.py
API Overview
pipeline.create
create_pipeline(...)
pipeline.load
load_pipeline(save_dir, file_name)
shared.utils
validate
validate_pipeline(pipeline, pipeline_type, contents)
math_util
normalize(obj, p, dim)mean_pooling(model_output, attention_mask)
shared.constants
- Configuration and path constants
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantizetk-0.0.1.tar.gz.
File metadata
- Download URL: quantizetk-0.0.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c92040cbfe3e29a82439c73cc431cd8e1bfa44935e725755f767803f5edbd3e
|
|
| MD5 |
182df0ad57c8039418412d0782c92de8
|
|
| BLAKE2b-256 |
37b6fc4b3c614d02bca812e3b1064c0a8c81ee81baa07fadc81c06cd90e30ae3
|
File details
Details for the file quantizetk-0.0.1-py3-none-any.whl.
File metadata
- Download URL: quantizetk-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc50d2dfc49cf4aff315491d71ae9d3b070761910e0282340adb0f2ede3a34e
|
|
| MD5 |
0f6e8c3437f60c5b7f1cf80f348ffd3b
|
|
| BLAKE2b-256 |
d1582a32abe33837b7e157c3b7dfb3f9601615250bce7538c3ed7e9d2779183f
|