transformers.js onnx gpt_neox text-generation base_model:Felladrin/Sheared-Pythia-160m-Platypus license:apache-2.0 region:us
---
license: apache-2.0
library_name: "transformers.js"
base_model: Felladrin/Sheared-Pythia-160m-Platypus
---

INT8 ONNX version of [Felladrin/Sheared-Pythia-160m-Platypus](https://huggingface.co/Felladrin/Sheared-Pythia-160m-Platypus) 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-Sheared-Pythia-160m-Platypus');
const output = await generator('### User:\nTell me all you know about the Earth.\n### Assistant:', { add_special_tokens: true, max_new_tokens: 64, repetition_penalty: 1.08, do_sample: true, temperature: 0.2 });
console.log(output);
// The Earth is a fascinating and mysterious land with an unusual atmosphere that attracts many people around it...
```

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

const model_path = 'Felladrin/onnx-Sheared-Pythia-160m-Platypus';
const model = await AutoModelForCausalLM.from_pretrained(model_path);
const tokenizer = await AutoTokenizer.from_pretrained(model_path);

const prompt = '### User:\nTell me all you know about the Earth.\n### Assistant:';
const { input_ids } = tokenizer(prompt);
const tokens = await model.generate(input_ids, { max_new_tokens: 64, repetition_penalty: 1.08, do_sample: true, temperature: 0.2 });
console.log(tokenizer.decode(tokens[0], { skip_special_tokens: true }));
// The Earth is a fascinating and mysterious land with an unusual atmosphere that attracts many people around it...
```
