Downloads · 30 days
15.5K
3% of all-time downloads
Xenova/llama2.c-stories15M
llama2.c-stories15M is a text generation model from Xenova. Use it when you need the model to write or continue text. It is set up for transformers.js.
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
Downloads · 30 days
15.5K
3% of all-time downloads
All-time downloads
498K
Public
Parameters
15.2M
2.5 GB on disk
Likes
7
Public
Click a slice to open those files.
.onnx967 MB · 89%
From the Hugging Face model README
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 text-generation pipeline
const generator = await pipeline('text-generation', 'Xenova/llama2.c-stories15M');
const text = 'Once upon a time,';
const output = await generator(text);
console.log(output);
// [{ generated_text: "Once upon a time, there was a little girl named Lily. She loved to play outside in" }]
const output2 = await generator(text, { max_new_tokens: 50 });
console.log(output2);
// [{ generated_text: "Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine. One day, she saw a big, dark cloud in the sky. She knew it was going to rain soon.\nLily ran inside her house" }]