Model Stock: All we need is just a few fine-tuned models
Paper • 2403.19522 • Published • 15
How to use lemon07r/llama-3-NeuralMahou-8b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="lemon07r/llama-3-NeuralMahou-8b") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("lemon07r/llama-3-NeuralMahou-8b")
model = AutoModelForCausalLM.from_pretrained("lemon07r/llama-3-NeuralMahou-8b", device_map="auto")How to use lemon07r/llama-3-NeuralMahou-8b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "lemon07r/llama-3-NeuralMahou-8b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lemon07r/llama-3-NeuralMahou-8b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/lemon07r/llama-3-NeuralMahou-8b
How to use lemon07r/llama-3-NeuralMahou-8b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "lemon07r/llama-3-NeuralMahou-8b" \
--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": "lemon07r/llama-3-NeuralMahou-8b",
"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 "lemon07r/llama-3-NeuralMahou-8b" \
--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": "lemon07r/llama-3-NeuralMahou-8b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use lemon07r/llama-3-NeuralMahou-8b with Docker Model Runner:
docker model run hf.co/lemon07r/llama-3-NeuralMahou-8b
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("lemon07r/llama-3-NeuralMahou-8b")
model = AutoModelForCausalLM.from_pretrained("lemon07r/llama-3-NeuralMahou-8b", device_map="auto")This is a merge of pre-trained language models created using mergekit.
This model was merged using the Model Stock merge method using mlabonne/NeuralDaredevil-8B-abliterated as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
base_model: mlabonne/NeuralDaredevil-8B-abliterated
dtype: bfloat16
merge_method: model_stock
slices:
- sources:
- layer_range: [0, 32]
model: flammenai/Mahou-1.2-llama3-8B
- layer_range: [0, 32]
model: nbeerbower/llama-3-spicy-abliterated-stella-8B
- layer_range: [0, 32]
model: mlabonne/NeuralDaredevil-8B-abliterated
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 71.33 |
| AI2 Reasoning Challenge (25-Shot) | 67.41 |
| HellaSwag (10-Shot) | 83.45 |
| MMLU (5-Shot) | 68.63 |
| TruthfulQA (0-shot) | 58.21 |
| Winogrande (5-shot) | 77.74 |
| GSM8k (5-shot) | 72.55 |
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lemon07r/llama-3-NeuralMahou-8b")