Instructions to use av-codes/Supra-50M-Instruct-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use av-codes/Supra-50M-Instruct-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'av-codes/Supra-50M-Instruct-ONNX');
| base_model: SupraLabs/Supra-50M-Instruct | |
| library_name: transformers.js | |
| tags: | |
| - onnx | |
| - transformers.js | |
| - llama | |
| - text-generation | |
| license: apache-2.0 | |
| # Supra-50M-Instruct ONNX | |
| ONNX weights for [SupraLabs/Supra-50M-Instruct](https://huggingface.co/SupraLabs/Supra-50M-Instruct), compatible with [Transformers.js](https://huggingface.co/docs/transformers.js). | |
| ## Usage (Transformers.js v3) | |
| ```javascript | |
| import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3"; | |
| const generator = await pipeline( | |
| "text-generation", | |
| "av-codes/Supra-50M-Instruct-ONNX", | |
| { dtype: "q8" }, | |
| ); | |
| const messages = [ | |
| { role: "user", content: "Explain what a neural network is in simple terms." }, | |
| ]; | |
| const output = await generator(messages, { max_new_tokens: 256 }); | |
| console.log(output[0].generated_text.at(-1).content); | |
| ``` | |
| ## Variants | |
| | Variant | File | Size | | |
| |---------|------|------| | |
| | fp32 | `onnx/model.onnx` | 199 MB | | |
| | q8 (int8) | `onnx/model_quantized.onnx` | 50 MB | | |
| ## Conversion | |
| Exported with [Optimum](https://huggingface.co/docs/optimum) and quantized with ONNX Runtime: | |
| ```bash | |
| optimum-cli export onnx --model SupraLabs/Supra-50M-Instruct --task text-generation-with-past ./onnx-export/ | |
| ``` | |