Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
8-bit precision
bitsandbytes
Instructions to use ramy21/tinyllama2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ramy21/tinyllama2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ramy21/tinyllama2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ramy21/tinyllama2") model = AutoModelForCausalLM.from_pretrained("ramy21/tinyllama2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ramy21/tinyllama2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ramy21/tinyllama2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ramy21/tinyllama2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ramy21/tinyllama2
- SGLang
How to use ramy21/tinyllama2 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 "ramy21/tinyllama2" \ --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": "ramy21/tinyllama2", "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 "ramy21/tinyllama2" \ --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": "ramy21/tinyllama2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ramy21/tinyllama2 with Docker Model Runner:
docker model run hf.co/ramy21/tinyllama2
Commit History
-
Upload LlamaForCausalLM
892dda8 -
Upload tokenizer
bd1d3cc -
Upload LlamaForCausalLM
4dad88f -
Upload tokenizer
488f965 -
Training in progress, step 200
ff93520 -
Training in progress, step 190
f18bb3c -
Training in progress, step 180
71aff09 -
Training in progress, step 170
b41d032 -
Training in progress, step 160
33b52c2 -
Training in progress, step 150
97fa392 -
Training in progress, step 140
ae38e94 -
Training in progress, step 130
b9e07e9 -
Training in progress, step 120
9f0cc1f -
Training in progress, step 110
84ae567 -
Training in progress, step 100
9709bd8 -
Training in progress, step 90
0641027 -
Training in progress, step 80
03af0a2 -
Training in progress, step 70
3156996 -
Training in progress, step 60
f49405a -
Training in progress, step 50
43e8f3d -
Training in progress, step 40
ec24463 -
Training in progress, step 30
95d2362 -
Training in progress, step 20
4ce6017 -
Training in progress, step 10
f1c6cd2 -
Upload generation_config.json
ef52c0b -
Delete generation_config.json
b5bbc8e -
Upload LlamaForCausalLM
c5bdb06 -
Delete config.json
ee1ac47 -
Upload 2 files
53f941a -
Upload tokenizer
02dac63 -
Training in progress, step 200
d9c2fc5 -
Training in progress, step 190
52753a4 -
Training in progress, step 180
3c1b1b3 -
Training in progress, step 170
9fd43f6 -
Training in progress, step 160
223ce51 -
Training in progress, step 150
07d9d51 -
Training in progress, step 140
10831d8 -
Training in progress, step 130
f4cf655 -
Training in progress, step 120
d77352d -
Training in progress, step 110
b7a45fa -
Training in progress, step 100
39994c7 -
Training in progress, step 90
6d2ca6f -
Training in progress, step 80
7c1a95c -
Training in progress, step 70
ed4b6e5 -
Training in progress, step 60
1b6066f -
Training in progress, step 50
4bef9fa -
Training in progress, step 40
94c5fb3 -
Training in progress, step 30
a433eb6 -
Training in progress, step 20
aefa11a -
Training in progress, step 10
6b86a75