Instructions to use afrideva/TinyLLama-v0-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use afrideva/TinyLLama-v0-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="afrideva/TinyLLama-v0-GGUF", filename="tinyllama-v0.fp16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use afrideva/TinyLLama-v0-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf afrideva/TinyLLama-v0-GGUF:Q4_K_M
Use Docker
docker model run hf.co/afrideva/TinyLLama-v0-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use afrideva/TinyLLama-v0-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "afrideva/TinyLLama-v0-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "afrideva/TinyLLama-v0-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/afrideva/TinyLLama-v0-GGUF:Q4_K_M
- Ollama
How to use afrideva/TinyLLama-v0-GGUF with Ollama:
ollama run hf.co/afrideva/TinyLLama-v0-GGUF:Q4_K_M
- Unsloth Studio
How to use afrideva/TinyLLama-v0-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for afrideva/TinyLLama-v0-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for afrideva/TinyLLama-v0-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for afrideva/TinyLLama-v0-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use afrideva/TinyLLama-v0-GGUF with Docker Model Runner:
docker model run hf.co/afrideva/TinyLLama-v0-GGUF:Q4_K_M
- Lemonade
How to use afrideva/TinyLLama-v0-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull afrideva/TinyLLama-v0-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.TinyLLama-v0-GGUF-Q4_K_M
List all available models
lemonade list
Maykeye/TinyLLama-v0-GGUF
Quantized GGUF model files for TinyLLama-v0 from Maykeye
| Name | Quant method | Size |
|---|---|---|
| tinyllama-v0.fp16.gguf | fp16 | 11.08 MB |
| tinyllama-v0.q2_k.gguf | q2_k | 5.47 MB |
| tinyllama-v0.q3_k_m.gguf | q3_k_m | 5.63 MB |
| tinyllama-v0.q4_k_m.gguf | q4_k_m | 5.79 MB |
| tinyllama-v0.q5_k_m.gguf | q5_k_m | 5.95 MB |
| tinyllama-v0.q6_k.gguf | q6_k | 6.72 MB |
| tinyllama-v0.q8_0.gguf | q8_0 | 6.75 MB |
Original Model Card:
This is a first version of recreating roneneldan/TinyStories-1M but using Llama architecture.
Full training process is included in the notebook train.ipynb. Recreating it as simple as downloading TinyStoriesV2-GPT4-train.txt and TinyStoriesV2-GPT4-valid.txt in the same folder with the notebook and running the cells. Validation content is not used by the script so you put anythin in
Backup directory has a script do_backup that I used to copy weights from remote machine to local. Weight are generated too quickly, so by the time script copied weihgt N+1
This is extremely PoC version. Training truncates stories that are longer than context size and doesn't use any sliding window to train story not from the start
Training took approximately 9 hours (3 hours per epoch) on 40GB A100. ~30GB VRAM was used
I use tokenizer from open_llama_3b. However I had troubles with it locally(https://github.com/openlm-research/open_llama/issues/69). I had no troubles on the cloud machine with preninstalled libraries.
Demo script is demo.py
Validation script is provided: valid.py. use it like
python valid.py path/to/TinyStoriesV2-GPT4-valid.txt [optional-model-id-or-path]: After training I decided that it's not necessary to beat validation into chunksAlso this version uses very stupid caching mechinsm to shuffle stories for training: it keeps cache of N recently loaded chunks so if random shuffle asks for a story, it may use cache or load chunk. Training dataset is too small, so in next versions I will get rid of it.
from transformers import AutoModelForCausalLM, AutoTokenizer
- Downloads last month
- 122
Model tree for afrideva/TinyLLama-v0-GGUF
Base model
Maykeye/TinyLLama-v0