Views
No views yet
story-model.gguf) and WebAssembly runtime (wllama.wasm) used by Kids Scroll — a lightweight, offline-first Progressive Web App (PWA) designed for toddlers and young children.story-model.gguf (~26 MB)wllama.wasm (~7.4 MB)roneneldan/TinyStories consisting of ~2.1 million synthetic short stories generated by GPT-3.5 / GPT-4.wllama (WebAssembly)1import { Wllama } from '@wllama/wllama';
2
3const wllama = new Wllama({
4 'wllama.wasm': 'https://huggingface.co/thekosmix/kids-scroll-models/resolve/main/wllama.wasm'
5});
6
7// Load the model
8const response = await fetch('https://huggingface.co/thekosmix/kids-scroll-models/resolve/main/story-model.gguf');
9const blob = await response.blob();
10await wllama.loadModel([blob], { n_ctx: 192 });
11
12// Generate a story segment
13const output = await wllama.createCompletion({
14 prompt: 'Once upon a time, there was a little rabbit.',
15 max_tokens: 100,
16 temperature: 0.8,
17 top_p: 0.9,
18 stop: ['\n\n', 'The end.']
19});
20
21console.log(output.choices[0].text);llama-cli -m story-model.gguf -p "Once upon a time, there was a friendly lion." -n 100 --temp 0.81@article{eldan2023tinystories,
2 title={TinyStories: How Small Can Language Models Be and Still Speak Coherent English?},
3 author={Eldan, Ronen and Li, Yuanzhi},
4 journal={arXiv preprint arXiv:2305.07759},
5 year={2023}
6}