File size: 1,694 Bytes
a9832f4
 
471bad6
 
 
 
 
 
 
 
 
 
a9832f4
471bad6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: bigscience-bloom-rail-1.0
datasets:
- ehartford/wizard_vicuna_70k_unfiltered
- shahules786/orca-chat
- timdettmers/openassistant-guanaco
- laion/OIG
language:
- fr
- en
library_name: "transformers.js"
base_model: cmarkea/bloomz-560m-sft-chat
---

INT8 ONNX version of [cmarkea/bloomz-560m-sft-chat](https://huggingface.co/cmarkea/bloomz-560m-sft-chat) to use with [Transformers.js](https://huggingface.co/docs/transformers.js).

### Example usage
#### Pipeline API
```js
import { pipeline } from '@xenova/transformers';

const generator = await pipeline('text-generation', 'Felladrin/onnx-bloomz-560m-sft-chat');
const output =  await generator('</s>What is the first world war?<s>', { add_special_tokens: true, max_new_tokens: 128, repetition_penalty: 1.2});
console.log(output); // The first world war was a conflict between the United States and the Soviet Union. The conflict began in World War II and lasted until the end of World War III.
```

#### Auto Classes
```js
import { AutoModelForCausalLM, AutoTokenizer } from '@xenova/transformers';

const model_path = 'Felladrin/onnx-bloomz-560m-sft-chat';
const model = await AutoModelForCausalLM.from_pretrained(model_path);
const tokenizer = await AutoTokenizer.from_pretrained(model_path);

const prompt = '</s>What is the first world war?<s>';
const { input_ids } = tokenizer(prompt);
const tokens = await model.generate(input_ids, { max_new_tokens: 128, repetition_penalty: 1.2});
console.log(tokenizer.decode(tokens[0], { skip_special_tokens: true }));
// The first world war was a conflict between the United States and the Soviet Union. The conflict began in World War II and lasted until the end of World War III.
```