Views
No views yet
microsoft/llmlingua-2-bert-base-multilingual-cased-meetingbank,
for running prompt compression in the browser with
Transformers.js.| file | size |
|---|---|
onnx/model_quantized.onnx | 179 MB — int8, this is what you want |
| mean | max | flipped | |
|---|---|---|---|
| this export, fp32 | 0.00000 | 0.0000 | 0 |
| this export, int8 per-channel | 0.01217 | 0.1049 | 1 |
| int8 per-tensor (not used) | 0.02916 | 0.2154 | 1 |
per_channel=True is deliberate — per-tensor quantization degrades roughly 3×
more for 1 MB less. reduce_range=True was also measured and made things
clearly worse, so it is not used.1import { pipeline } from '@xenova/transformers';
2
3const pipe = await pipeline(
4 'token-classification',
5 'clarenceorg/llmlingua-2-onnx',
6 { quantized: true }
7);id2label, so labels come out as LABEL_0 / LABEL_1.
LABEL_1 means "keep the token"; p(keep) for LABEL_0 is 1 - score.index field skips
values). Aligning a cursor over that stream desynchronises it permanently.
Re-tokenize yourself and join scores back by index.1@inproceedings{pan2024llmlingua2,
2 title = {{LLMLingua-2}: Data Distillation for Efficient and Faithful
3 Task-Agnostic Prompt Compression},
4 author = {Pan, Zhuoshi and Wu, Qianhui and Jiang, Huiqiang and Xia, Menglin
5 and Luo, Xufang and Zhang, Jue and Lin, Qingwei and Rühle, Victor
6 and Yang, Yuqing and Lin, Chin-Yew and Zhao, H. Vicky and Qiu, Lili
7 and Zhang, Dongmei},
8 booktitle = {Findings of ACL 2024},
9 year = {2024}
10}NOTICE file in this repository.