Views
No views yet
1import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3";
2
3const generator = await pipeline(
4 "text-generation",
5 "av-codes/Supra-50M-Instruct-ONNX",
6 { dtype: "q8" },
7);
8
9const messages = [
10 { role: "user", content: "Explain what a neural network is in simple terms." },
11];
12
13const output = await generator(messages, { max_new_tokens: 256 });
14console.log(output[0].generated_text.at(-1).content);| Variant | File | Size |
|---|---|---|
| fp32 | onnx/model.onnx | 199 MB |
| q8 (int8) | onnx/model_quantized.onnx | 50 MB |
optimum-cli export onnx --model SupraLabs/Supra-50M-Instruct --task text-generation-with-past ./onnx-export/