Add tokenizer.json and config.json for both models (unchanged, from the originals at the same revisions): builds need nothing from the original repositories
9cc21c6 verified |
Download README.md from helloravisha/classification-engine-models: direct link, hf CLI and curl.
- Browser
- Download file 4.07 kB
-
https://huggingface.co/helloravisha/classification-engine-models/resolve/main/README.md
- Command line
-
hf download hf://helloravisha/classification-engine-models/README.md
-
curl -L -o README.md https://huggingface.co/helloravisha/classification-engine-models/resolve/main/README.md
4.07 kB
| license: other | |
| license_name: per-model | |
| license_link: LICENSE.md | |
| tags: | |
| - onnx | |
| - text-classification | |
| - zero-shot-classification | |
| - prompt-injection | |
| # Classification engine models | |
| Model files used by a classification engine service (ONNX Runtime on CPU) to check user questions before they reach | |
| a language model: a **prompt-injection** classifier and a **topic** (in-scope or not) classifier. | |
| This repository is a **build mirror**: Docker image builds download these files instead of the originals, so the | |
| expensive compression step (the topic model needs ~10 GB of memory to compress) runs only once. Every file is pinned | |
| by its SHA-256 in the engine's source code; a build refuses any file that doesn't match. | |
| **These are not new models.** All credit goes to the original authors; each folder carries the original model card | |
| (`ORIGINAL-MODEL-CARD.md`, with its license) at the exact version used. | |
| ## Files | |
| Layout: `<name>/<original revision>/model.onnx`. A new version of a model gets a new folder; nothing is overwritten. | |
| | Path | What it is | Original | License | SHA-256 | | |
| |---|---|---|---|---| | |
| | `topic/9abf1c8aaeb82a2447809c20753ed0b106b76652/model.onnx` (0.57 GB) | **8-bit compression** of the original's `onnx/model.onnx` (2.3 GB) | [MoritzLaurer/bge-m3-zeroshot-v2.0](https://huggingface.co/MoritzLaurer/bge-m3-zeroshot-v2.0/tree/9abf1c8aaeb82a2447809c20753ed0b106b76652) @ `9abf1c8a` | MIT | `a7eb4f68f0c75e1a0740f98ffeffa550f0a7758fe7f72519e9035d670c8ba12b` | | |
| | `injection/2efc2ed5abecd21eb45c2506d231a65d6e392b85/model.onnx` (0.27 GB) | **unchanged copy** of the original's `onnx/model_quantized.onnx` | [Horizon-Labs/prompt-injection-guard-small](https://huggingface.co/Horizon-Labs/prompt-injection-guard-small/tree/2efc2ed5abecd21eb45c2506d231a65d6e392b85) @ `2efc2ed5` | Apache 2.0 | `61cd0741cdbfcc229e32e1de1392f352736d87d1e8b3c2b67ad9836bb7910d5d` | | |
| Each folder holds everything a build needs, so builds using this mirror don't depend on the original repositories: | |
| | File in each folder | What it is | Taken from the original at the same revision | | |
| |---|---|---| | |
| | `model.onnx` | the model (see table above) | topic: compressed by us; injection: unchanged | | |
| | `tokenizer.json` | how text is split into tokens | unchanged | | |
| | `config.json` | label names and model settings | unchanged | | |
| | `ORIGINAL-MODEL-CARD.md` | the author's model card (`README.md` there): description, credits, license | unchanged | | |
| SHA-256 of the small files: | |
| | File | SHA-256 | | |
| |---|---| | |
| | `topic/9abf1c8a…/tokenizer.json` | `6710678b12670bc442b99edc952c4d996ae309a7020c1fa0096dd245c2faf790` | | |
| | `topic/9abf1c8a…/config.json` | `5449085fe904cdb0715398c7abf7fd049c3fc057e06353aa6a4701a6180ae4a1` | | |
| | `topic/9abf1c8a…/ORIGINAL-MODEL-CARD.md` | `2498f63dc8218452c6b0084b35b901c1341f3827278b3de6d992cd72946b15e0` | | |
| | `injection/2efc2ed5…/tokenizer.json` | `47834a7dbbb0c4324fe9569fe47955241594a9ee539c9e478755d6fbc51e5f46` | | |
| | `injection/2efc2ed5…/config.json` | `d6264037c9aa4b3d821c1c9a0329572033adbdb622788ecca91c3636066d9622` | | |
| | `injection/2efc2ed5…/ORIGINAL-MODEL-CARD.md` | `875a62fbe80e7536c02f523e85b7c10abd96ecda6f41a9622a2f455338e37e9c` | | |
| ## How the topic file was made | |
| Dynamic 8-bit quantization of the original ONNX model with ONNX Runtime: | |
| ```python | |
| from onnxruntime.quantization import QuantType, quantize_dynamic | |
| quantize_dynamic("model.onnx", "model-int8.onnx", weight_type=QuantType.QInt8) # onnx 1.23.2, onnxruntime 1.32.0 | |
| ``` | |
| Scores stay close to the original (e.g. "Is SUNPHARMA a buy?" finance 0.927 full size → 0.908 compressed, with the | |
| hypothesis "This message is about stocks, trading, investing, markets, the economy or personal finance."). It was | |
| checked on a labelled benchmark before use. Scores can differ slightly between CPUs (8-bit maths). | |
| ## Licenses | |
| See [LICENSE.md](LICENSE.md): each file is under its original model's license (MIT for the topic model, Apache 2.0 | |
| for the injection model). The original model cards, with their full terms and credits, are in each folder as | |
| `ORIGINAL-MODEL-CARD.md`. | |