File size: 1,240 Bytes
21bdbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128c407
21bdbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
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/
```