Downloads · 30 days
69
5% of all-time downloads
Xenova/flan-alpaca-base
flan-alpaca-base is a machine learning model from Xenova. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.js.
https://huggingface.co/declare-lab/flan-alpaca-base with ONNX weights to be compatible with Transformers.js.
Downloads · 30 days
69
5% of all-time downloads
All-time downloads
1.4K
Public
Repo size
7.4 GB
Likes
1
Public
Click a slice to open those files.
.onnx8.1 GB · 100%
From the Hugging Face model README
https://huggingface.co/declare-lab/flan-alpaca-base with ONNX weights to be compatible with Transformers.js.
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @huggingface/transformers
You can then use the model to generate text like this:
import { pipeline } from "@huggingface/transformers";
// Create a text2text-generation pipeline
const generator = await pipeline('text2text-generation', 'Xenova/flan-alpaca-base');
// Generate text
const output = await generator('What is Python?', {
max_length: 128,
do_sample: true,
top_k: 10,
dtype: "fp32" // Options: "fp32", "fp16", "q8", "q4"
});
console.log(output);
// [{ generated_text: 'Python is a programming language used in many applications, such as machine learning, database management, and graphical application development. It is a multi-functional language which works across various data sets and platforms.' }]
Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using 🤗 Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).