Instructions to use LeoLearntoCode/llama-1.3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LeoLearntoCode/llama-1.3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LeoLearntoCode/llama-1.3b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LeoLearntoCode/llama-1.3b") model = AutoModelForCausalLM.from_pretrained("LeoLearntoCode/llama-1.3b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LeoLearntoCode/llama-1.3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LeoLearntoCode/llama-1.3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeoLearntoCode/llama-1.3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LeoLearntoCode/llama-1.3b
- SGLang
How to use LeoLearntoCode/llama-1.3b 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 "LeoLearntoCode/llama-1.3b" \ --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": "LeoLearntoCode/llama-1.3b", "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 "LeoLearntoCode/llama-1.3b" \ --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": "LeoLearntoCode/llama-1.3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LeoLearntoCode/llama-1.3b with Docker Model Runner:
docker model run hf.co/LeoLearntoCode/llama-1.3b
Upload LlamaForCausalLM
Browse files- config.json +3 -2
- generation_config.json +1 -1
config.json
CHANGED
|
@@ -10,7 +10,8 @@
|
|
| 10 |
"hidden_size": 2048,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 5504,
|
| 13 |
-
"max_position_embeddings":
|
|
|
|
| 14 |
"model_type": "llama",
|
| 15 |
"num_attention_heads": 32,
|
| 16 |
"num_hidden_layers": 24,
|
|
@@ -22,7 +23,7 @@
|
|
| 22 |
"rope_theta": 10000.0,
|
| 23 |
"tie_word_embeddings": true,
|
| 24 |
"torch_dtype": "float16",
|
| 25 |
-
"transformers_version": "4.
|
| 26 |
"use_cache": true,
|
| 27 |
"vocab_size": 50277
|
| 28 |
}
|
|
|
|
| 10 |
"hidden_size": 2048,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 5504,
|
| 13 |
+
"max_position_embeddings": 16384,
|
| 14 |
+
"mlp_bias": false,
|
| 15 |
"model_type": "llama",
|
| 16 |
"num_attention_heads": 32,
|
| 17 |
"num_hidden_layers": 24,
|
|
|
|
| 23 |
"rope_theta": 10000.0,
|
| 24 |
"tie_word_embeddings": true,
|
| 25 |
"torch_dtype": "float16",
|
| 26 |
+
"transformers_version": "4.41.1",
|
| 27 |
"use_cache": true,
|
| 28 |
"vocab_size": 50277
|
| 29 |
}
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.41.1"
|
| 7 |
}
|