Downloads · 30 days
14
19% of all-time downloads
Felladrin/onnx-Sheared-Pythia-160m-Platypus
onnx-Sheared-Pythia-160m-Platypus is a text generation model from Felladrin. Use it when you need the model to write or continue text. It is set up for transformers.js. The card lists the license as apache-2.0.
INT8 ONNX version of Felladrin/Sheared-Pythia-160m-Platypus to use with Transformers.js.
Downloads · 30 days
14
19% of all-time downloads
All-time downloads
73
Public
Repo size
823 MB
Likes
0
Public
Click a slice to open those files.
.onnx823 MB · 100%
From the Hugging Face model README
INT8 ONNX version of Felladrin/Sheared-Pythia-160m-Platypus to use with Transformers.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...
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...