Views
No views yet
npm i @huggingface/transformersLemOneLabs/Llama-3.2-1B-Instruct-ONNX.1import { pipeline } from "@huggingface/transformers";
2
3// Create a text generation pipeline
4const generator = await pipeline("text-generation", "LemOneLabs/Llama-3.2-1B-Instruct-ONNX");
5
6// Define the list of messages
7const messages = [
8 { role: "system", content: "You are a helpful assistant." },
9 { role: "user", content: "Tell me a joke." },
10];
11
12// Generate a response
13const output = await generator(messages, { max_new_tokens: 128 });
14console.log(output[0].generated_text.at(-1).content);Here's a joke for you:
What do you call a fake noodle?
An impasta!
I hope that made you laugh! Do you want to hear another one?onnx).