Depth pruned and fine tuned Llama-3.1-8B
Collection
5 items • Updated
How to use Na0s/Llama-3.1-8B-Pruned-4-Layers with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Na0s/Llama-3.1-8B-Pruned-4-Layers") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Na0s/Llama-3.1-8B-Pruned-4-Layers")
model = AutoModelForCausalLM.from_pretrained("Na0s/Llama-3.1-8B-Pruned-4-Layers")How to use Na0s/Llama-3.1-8B-Pruned-4-Layers with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Na0s/Llama-3.1-8B-Pruned-4-Layers"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Na0s/Llama-3.1-8B-Pruned-4-Layers",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Na0s/Llama-3.1-8B-Pruned-4-Layers
How to use Na0s/Llama-3.1-8B-Pruned-4-Layers with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Na0s/Llama-3.1-8B-Pruned-4-Layers" \
--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": "Na0s/Llama-3.1-8B-Pruned-4-Layers",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Na0s/Llama-3.1-8B-Pruned-4-Layers" \
--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": "Na0s/Llama-3.1-8B-Pruned-4-Layers",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Na0s/Llama-3.1-8B-Pruned-4-Layers with Docker Model Runner:
docker model run hf.co/Na0s/Llama-3.1-8B-Pruned-4-Layers
This is a merge of meta-llama/Meta-Llama-3.1-8B created using mergekit, with respect to the paper "The Unreasonable Ineffectiveness of the Deeper Layers"
This model was merged using the passthrough merge method.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
dtype: bfloat16
merge_method: passthrough
slices:
- sources:
- layer_range: [0, 23]
model: meta-llama/Meta-Llama-3.1-8B
- sources:
- layer_range: [28, 32]
model: meta-llama/Meta-Llama-3.1-8B
MMLU Pro 0-shot: 0.2642
[TIGER-AI-Lab/MMLU-Pro]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).