Text Generation
Transformers
Safetensors
English
llama
tinystories
language-model
educational
text-generation-inference
Instructions to use manojredhat/tiny-llama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use manojredhat/tiny-llama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="manojredhat/tiny-llama")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("manojredhat/tiny-llama") model = AutoModelForCausalLM.from_pretrained("manojredhat/tiny-llama") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use manojredhat/tiny-llama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "manojredhat/tiny-llama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "manojredhat/tiny-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/manojredhat/tiny-llama
- SGLang
How to use manojredhat/tiny-llama 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 "manojredhat/tiny-llama" \ --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": "manojredhat/tiny-llama", "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 "manojredhat/tiny-llama" \ --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": "manojredhat/tiny-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use manojredhat/tiny-llama with Docker Model Runner:
docker model run hf.co/manojredhat/tiny-llama
Fix: Properly convert to HuggingFace LLaMA format with correct weight mapping and architecture
Browse files- config.json +1 -1
- model.safetensors +2 -2
- tokenizer_config.json +1 -0
config.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
"hidden_act": "silu",
|
| 9 |
"hidden_size": 288,
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
-
"intermediate_size":
|
| 12 |
"max_position_embeddings": 2048,
|
| 13 |
"model_type": "llama",
|
| 14 |
"num_attention_heads": 6,
|
|
|
|
| 8 |
"hidden_act": "silu",
|
| 9 |
"hidden_size": 288,
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 768,
|
| 12 |
"max_position_embeddings": 2048,
|
| 13 |
"model_type": "llama",
|
| 14 |
"num_attention_heads": 6,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d910edc7031721de23a7af111e355e6c09d5f1b3a2c43c0b6b0aa6a9135ffe03
|
| 3 |
+
size 25088592
|
tokenizer_config.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
"legacy": false,
|
| 6 |
"model_max_length": 2048,
|
| 7 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
| 8 |
"bos_token": {
|
| 9 |
"__type": "AddedToken",
|
| 10 |
"content": "<s>",
|
|
|
|
| 5 |
"legacy": false,
|
| 6 |
"model_max_length": 2048,
|
| 7 |
"tokenizer_class": "LlamaTokenizer",
|
| 8 |
+
"pad_token": "<unk>",
|
| 9 |
"bos_token": {
|
| 10 |
"__type": "AddedToken",
|
| 11 |
"content": "<s>",
|