Felladrin/onnx-Sheared-Pythia-160m
By Felladrin · ↓ 4 · ♥ 0 · Updated 2023-11-23
What's in this repo
This page lists the files in Felladrin/onnx-Sheared-Pythia-160m, including decoder_model_merged.onnx, decoder_model_merged_quantized.onnx.
- 2 ONNX models (.onnx files)
- 10 files, including 6 .json, 2 .onnx, 1 .md
- Last updated 2023-11-23
ONNX files
| File | Size | Download |
|---|---|---|
| onnx/decoder_model_merged.onnx | — | Download |
| onnx/decoder_model_merged_quantized.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
INT8 ONNX version of princeton-nlp/Sheared-Pythia-160m to use with Transformers.js.
Example usage
Pipeline API
import { pipeline } from '@xenova/transformers';
const generator = await pipeline('text-generation', 'Felladrin/onnx-Sheared-Pythia-160m');
const output = await generator('Once upon a time,', { add_special_tokens: true, max_new_tokens: 60, repetition_penalty: 1.2});
console.log(output);
Auto Classes
import { AutoModelForCausalLM, AutoTokenizer } from '@xenova/transformers';
const model_path = 'Felladrin/onnx-Sheared-Pythia-160m';
const model = await AutoModelForCausalLM.from_pretrained(model_path);
const tokenizer = await AutoTokenizer.from_pretrained(model_path);
const prompt = 'Once upon a time,';
const { input_ids } = tokenizer(prompt);
const tokens = await model.generate(input_ids, { max_new_tokens: 60, repetition_penalty: 1.2});
console.log(tokenizer.decode(tokens[0], { skip_special_tokens: true }));
Model info
text-generation
transformers.js
transformers.js
onnx
gpt_neox
text-generation
base_model:princeton-nlp/Sheared-Pythia-160m
base_model:quantized:princeton-nlp/Sheared-Pythia-160m
license:apache-2.0
region:us
↓ 4
♥ 0
Created: 2023-11-23
Updated: 2023-11-23
View on Hugging FaceFiles (10)
.gitattributes
README.md
config.json
generation_config.json
onnx/decoder_model_merged.onnx
ONNX
quantize_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json