Instructions to use afrideva/Tinystories-gpt-0.1-3m-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="afrideva/Tinystories-gpt-0.1-3m-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("afrideva/Tinystories-gpt-0.1-3m-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use afrideva/Tinystories-gpt-0.1-3m-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/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf afrideva/Tinystories-gpt-0.1-3m-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/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
Use Docker
docker model run hf.co/afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "afrideva/Tinystories-gpt-0.1-3m-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/Tinystories-gpt-0.1-3m-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
- SGLang
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "afrideva/Tinystories-gpt-0.1-3m-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "afrideva/Tinystories-gpt-0.1-3m-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "afrideva/Tinystories-gpt-0.1-3m-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "afrideva/Tinystories-gpt-0.1-3m-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with Ollama:
ollama run hf.co/afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with Docker Model Runner:
docker model run hf.co/afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
- Lemonade
How to use afrideva/Tinystories-gpt-0.1-3m-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull afrideva/Tinystories-gpt-0.1-3m-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Tinystories-gpt-0.1-3m-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Tinystories-gpt-0.1-3m-GGUF
Quantized GGUF model files for Tinystories-gpt-0.1-3m from segestic
Original Model Card:
We tried to use the huggingface transformers library to recreate the TinyStories models on Consumer GPU using GPT2 Architecture instead of GPT-Neo Architecture orignally used in the paper (https://arxiv.org/abs/2305.07759). Output model is 15mb and has 3 million parameters.
------ EXAMPLE USAGE 1 ---
from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("segestic/Tinystories-gpt-0.1-3m")
model = AutoModelForCausalLM.from_pretrained("segestic/Tinystories-gpt-0.1-3m")
prompt = "Once upon a time there was"
input_ids = tokenizer.encode(prompt, return_tensors="pt")
Generate completion
output = model.generate(input_ids, max_length = 1000, num_beams=1)
Decode the completion
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
Print the generated text
print(output_text)
------ EXAMPLE USAGE 2 ------
Use a pipeline as a high-level helper
from transformers import pipeline
pipeline
pipe = pipeline("text-generation", model="segestic/Tinystories-gpt-0.1-3m")
prompt
prompt = "where is the little girl"
generate completion
output = pipe(prompt, max_length=1000, num_beams=1)
decode the completion
generated_text = output[0]['generated_text']
Print the generated text
print(generated_text)
- Downloads last month
- 3,326
Model tree for afrideva/Tinystories-gpt-0.1-3m-GGUF
Base model
segestic/Tinystories-gpt-0.1-3m