Spaetzle
Collection
German-English models, mostly merged, some sft/dpo β’ 117 items β’ Updated β’ 1
How to use cstr/llama3-8b-spaetzle-v33 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cstr/llama3-8b-spaetzle-v33")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cstr/llama3-8b-spaetzle-v33")
model = AutoModelForCausalLM.from_pretrained("cstr/llama3-8b-spaetzle-v33")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use cstr/llama3-8b-spaetzle-v33 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cstr/llama3-8b-spaetzle-v33"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cstr/llama3-8b-spaetzle-v33",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cstr/llama3-8b-spaetzle-v33
How to use cstr/llama3-8b-spaetzle-v33 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cstr/llama3-8b-spaetzle-v33" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cstr/llama3-8b-spaetzle-v33",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "cstr/llama3-8b-spaetzle-v33" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cstr/llama3-8b-spaetzle-v33",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cstr/llama3-8b-spaetzle-v33 with Docker Model Runner:
docker model run hf.co/cstr/llama3-8b-spaetzle-v33
This is a merge of the following models:
It attempts a compromise in usefulness for German and English tasks.
For GGUF quants see cstr/llama3-8b-spaetzle-v33-GGUF,
It achieves on EQ-Bench v2_de as q4km (old version without pre-tokenizer-fix) quants 66.59 (171 of 171 parseable) and 73.17 on v2 (english) (171/171).
For the int4-inc quants:
| Benchmark | Score |
|---|---|
| Average | 66.13 |
| ARC-c | 59.81 |
| ARC-e | 85.27 |
| Boolq | 84.10 |
| HellaSwag | 62.47 |
| Lambada | 73.28 |
| MMLU | 64.11 |
| OpenbookQA | 37.2 |
| Piqa | 80.30 |
| TruthfulQA | 50.21 |
| Winogrande | 73.72 |
| Model | Average | AGIEval | GPT4All | TruthfulQA | Bigbench |
|---|---|---|---|---|---|
| mlabonne/Daredevil-8B π | 55.87 | 44.13 | 73.52 | 59.05 | 46.77 |
| cstr/llama3-8b-spaetzle-v33 π | 55.26 | 42.61 | 73.9 | 59.28 | 45.25 |
| mlabonne/Daredevil-8B-abliterated π | 55.06 | 43.29 | 73.33 | 57.47 | 46.17 |
| NousResearch/Hermes-2-Theta-Llama-3-8B π | 54.28 | 43.9 | 72.62 | 56.36 | 44.23 |
| openchat/openchat-3.6-8b-20240522 π | 53.49 | 44.03 | 73.67 | 49.78 | 46.48 |
| mlabonne/Llama-3-8B-Instruct-abliterated-dpomix π | 52.26 | 41.6 | 69.95 | 54.22 | 43.26 |
| meta-llama/Meta-Llama-3-8B-Instruct π | 51.34 | 41.22 | 69.86 | 51.65 | 42.64 |
| failspy/Meta-Llama-3-8B-Instruct-abliterated-v3 π | 51.21 | 40.23 | 69.5 | 52.44 | 42.69 |
| mlabonne/OrpoLlama-3-8B π | 48.63 | 34.17 | 70.59 | 52.39 | 37.36 |
| meta-llama/Meta-Llama-3-8B π | 45.42 | 31.1 | 69.95 | 43.91 | 36.7 |
models:
- model: cstr/llama3-8b-spaetzle-v20
# no parameters necessary for base model
- model: cstr/llama3-8b-spaetzle-v31
parameters:
density: 0.65
weight: 0.25
- model: cstr/llama3-8b-spaetzle-v28
parameters:
density: 0.65
weight: 0.25
- model: cstr/llama3-8b-spaetzle-v26
parameters:
density: 0.65
weight: 0.15
merge_method: dare_ties
base_model: cstr/llama3-8b-spaetzle-v20
parameters:
int8_mask: true
dtype: bfloat16
random_seed: 0
tokenizer_source: base
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "cstr/llama3-8b-spaetzle-v33"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])