https://huggingface.co/declare-lab/flan-alpaca-base with ONNX weights to be compatible with Transformers.js.

Usage (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).

Downloads last month
38
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Xenova/flan-alpaca-base

Quantized
(2)
this model