Instructions to use mit-han-lab/nunchaku-t5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mit-han-lab/nunchaku-t5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mit-han-lab/nunchaku-t5")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mit-han-lab/nunchaku-t5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mit-han-lab/nunchaku-t5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mit-han-lab/nunchaku-t5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mit-han-lab/nunchaku-t5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mit-han-lab/nunchaku-t5
- SGLang
How to use mit-han-lab/nunchaku-t5 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mit-han-lab/nunchaku-t5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mit-han-lab/nunchaku-t5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mit-han-lab/nunchaku-t5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mit-han-lab/nunchaku-t5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mit-han-lab/nunchaku-t5 with Docker Model Runner:
docker model run hf.co/mit-han-lab/nunchaku-t5
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/t5-v1_1-xxl
|
| 3 |
+
base_model_relation: quantized
|
| 4 |
+
datasets:
|
| 5 |
+
- mit-han-lab/svdquant-datasets
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
library_name: transformers
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
tags:
|
| 12 |
+
- text-generation
|
| 13 |
+
- AWQ
|
| 14 |
+
- Quantization
|
| 15 |
+
|
| 16 |
+
---
|
| 17 |
+
**This repository has been migrated to https://huggingface.co/nunchaku-tech/nunchaku-t5 and will be hidden in December 2025.**
|
| 18 |
+
|
| 19 |
+
<p align="center" style="border-radius: 10px">
|
| 20 |
+
<img src="https://huggingface.co/datasets/nunchaku-tech/cdn/resolve/main/nunchaku/assets/nunchaku.svg" width="30%" alt="Nunchaku Logo"/>
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
# Model Card for nunchaku-t5
|
| 24 |
+
|
| 25 |
+
This repository contains Nunchaku-quantized versions of [T5-XXL](https://huggingface.co/google/t5-v1_1-xxl), used to encode text prompt to the embeddings. It is used to reduce the memory footprint of the model.
|
| 26 |
+
|
| 27 |
+
## Model Details
|
| 28 |
+
|
| 29 |
+
### Model Description
|
| 30 |
+
|
| 31 |
+
- **Developed by:** Nunchaku Team
|
| 32 |
+
- **Model type:** text-generation
|
| 33 |
+
- **License:** apache-2.0
|
| 34 |
+
- **Quantized from model:** [t5_v1_1_xxl](https://huggingface.co/google/t5-v1_1-xxl)
|
| 35 |
+
|
| 36 |
+
### Model Files
|
| 37 |
+
|
| 38 |
+
- [`awq-int4-flux.1-t5xxl.safetensors`](./awq-int4-flux.1-t5xxl.safetensors): AWQ quantized W4A16 T5-XXL model for FLUX.1.
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
### Model Sources
|
| 42 |
+
|
| 43 |
+
- **Inference Engine:** [nunchaku](https://github.com/nunchaku-tech/nunchaku)
|
| 44 |
+
- **Quantization Library:** [deepcompressor](https://github.com/nunchaku-tech/deepcompressor)
|
| 45 |
+
- **Paper:** [SVDQuant: Absorbing Outliers by Low-Rank Components for 4-Bit Diffusion Models](http://arxiv.org/abs/2411.05007)
|
| 46 |
+
- **Demo:** [svdquant.mit.edu](https://svdquant.mit.edu)
|
| 47 |
+
|
| 48 |
+
## Usage
|
| 49 |
+
|
| 50 |
+
- Diffusers Usage: See [flux.1-dev-qencoder.py](https://github.com/nunchaku-tech/nunchaku/blob/main/examples/flux.1-dev-qencoder.py). Check our [tutorial](https://nunchaku.tech/docs/nunchaku/usage/qencoder.html) for more advanced usage.
|
| 51 |
+
- ComfyUI Usage: See [nunchaku-flux.1-dev-qencoder.json](https://nunchaku.tech/docs/ComfyUI-nunchaku/workflows/t2i.html#nunchaku-flux-1-dev-qencoder-json).
|
| 52 |
+
|
| 53 |
+
## Citation
|
| 54 |
+
|
| 55 |
+
```bibtex
|
| 56 |
+
@inproceedings{
|
| 57 |
+
li2024svdquant,
|
| 58 |
+
title={SVDQuant: Absorbing Outliers by Low-Rank Components for 4-Bit Diffusion Models},
|
| 59 |
+
author={Li*, Muyang and Lin*, Yujun and Zhang*, Zhekai and Cai, Tianle and Li, Xiuyu and Guo, Junxian and Xie, Enze and Meng, Chenlin and Zhu, Jun-Yan and Han, Song},
|
| 60 |
+
booktitle={The Thirteenth International Conference on Learning Representations},
|
| 61 |
+
year={2025}
|
| 62 |
+
}
|
| 63 |
+
@inproceedings{
|
| 64 |
+
lin2023awq,
|
| 65 |
+
title={AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration},
|
| 66 |
+
author={Lin, Ji and Tang, Jiaming and Tang, Haotian and Yang, Shang and Chen, Wei-Ming and Wang, Wei-Chen and Xiao, Guangxuan and Dang, Xingyu and Gan, Chuang and Han, Song},
|
| 67 |
+
booktitle={MLSys},
|
| 68 |
+
year={2024}
|
| 69 |
+
}
|
| 70 |
+
```
|