LeoLM/wikitext-en-de
Viewer • Updated • 11.2k • 49 • 7
How to use cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ")
model = AutoModelForCausalLM.from_pretrained("cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ", device_map="auto")
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=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ
How to use cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ" \
--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": "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ",
"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 "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ" \
--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": "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ with Docker Model Runner:
docker model run hf.co/cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ
This is a quantized model of Llama-3-SauerkrautLM-70b-Instruct using GPTQ developed by IST Austria using the following configuration:
Install vLLM and run the server:
python -m vllm.entrypoints.openai.api_server --model cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ
Access the model:
curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d ' {
"model": "cortecs/Llama-3-SauerkrautLM-70b-Instruct-GPTQ",
"prompt": "San Francisco is a"
} '
| English | Llama-3-SauerkrautLM-70b-Instruct | Llama-3-SauerkrautLM-70b-Instruct-GPTQ-8b | Llama-3-SauerkrautLM-70b-Instruct-GPTQ |
|---|---|---|---|
| Avg. | 78.17 | 78.1 | 76.72 |
| ARC | 74.5 | 74.4 | 73.0 |
| Hellaswag | 79.2 | 79.2 | 78.0 |
| MMLU | 80.8 | 80.7 | 79.15 |
| German | Llama-3-SauerkrautLM-70b-Instruct | Llama-3-SauerkrautLM-70b-Instruct-GPTQ-8b | Llama-3-SauerkrautLM-70b-Instruct-GPTQ |
| Avg. | 70.83 | 70.47 | 69.13 |
| ARC_de | 66.7 | 66.2 | 65.9 |
| Hellaswag_de | 70.8 | 71.0 | 68.8 |
| MMLU_de | 75.0 | 74.2 | 72.7 |
| Safety | Llama-3-SauerkrautLM-70b-Instruct | Llama-3-SauerkrautLM-70b-Instruct-GPTQ-8b | Llama-3-SauerkrautLM-70b-Instruct-GPTQ |
| Avg. | 65.86 | 65.94 | 65.94 |
| RealToxicityPrompts | 97.6 | 97.8 | 98.4 |
| TruthfulQA | 67.07 | 66.92 | 65.56 |
| CrowS | 32.92 | 33.09 | 33.87 |
We did not check for data contamination.
Evaluation was done using Eval. Harness using limit=1000.
| requests/s | tokens/s | |
|---|---|---|
| NVIDIA L40Sx2 | 2.19 | 1044.76 |
| Performance measured on cortecs inference. |