Salesforce/wikitext
Viewer • Updated • 3.71M • 1.33M • 690
How to use cortecs/Meta-Llama-3-8B-Instruct-GPTQ with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cortecs/Meta-Llama-3-8B-Instruct-GPTQ")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cortecs/Meta-Llama-3-8B-Instruct-GPTQ")
model = AutoModelForCausalLM.from_pretrained("cortecs/Meta-Llama-3-8B-Instruct-GPTQ")
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 cortecs/Meta-Llama-3-8B-Instruct-GPTQ with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cortecs/Meta-Llama-3-8B-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/Meta-Llama-3-8B-Instruct-GPTQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cortecs/Meta-Llama-3-8B-Instruct-GPTQ
How to use cortecs/Meta-Llama-3-8B-Instruct-GPTQ with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cortecs/Meta-Llama-3-8B-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/Meta-Llama-3-8B-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/Meta-Llama-3-8B-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/Meta-Llama-3-8B-Instruct-GPTQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cortecs/Meta-Llama-3-8B-Instruct-GPTQ with Docker Model Runner:
docker model run hf.co/cortecs/Meta-Llama-3-8B-Instruct-GPTQ
This is a quantized model of Meta-Llama-3-8B-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/Meta-Llama-3-8B-Instruct-GPTQ
Access the model:
curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d ' {
"model": "cortecs/Meta-Llama-3-8B-Instruct-GPTQ",
"prompt": "San Francisco is a"
} '
| English | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
|---|---|---|---|
| Avg. | 66.97 | 67.0 | 63.52 |
| ARC | 62.5 | 62.5 | 54.6 |
| Hellaswag | 70.3 | 70.3 | 69.5 |
| MMLU | 68.11 | 68.21 | 66.46 |
| French | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
| Avg. | 57.73 | 57.7 | 53.33 |
| Hellaswag_fr | 61.7 | 62.2 | 59.3 |
| ARC_fr | 53.3 | 53.1 | 46.4 |
| MMLU_fr | 58.2 | 57.8 | 54.3 |
| German | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
| Avg. | 53.47 | 53.67 | 49.0 |
| ARC_de | 49.1 | 49.0 | 41.6 |
| Hellaswag_de | 55.0 | 55.2 | 53.3 |
| MMLU_de | 56.3 | 56.8 | 52.1 |
| Italian | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
| Avg. | 56.73 | 56.67 | 51.3 |
| Hellaswag_it | 61.3 | 61.3 | 58.4 |
| MMLU_it | 57.3 | 57.0 | 53.0 |
| ARC_it | 51.6 | 51.7 | 42.5 |
| Safety | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
| Avg. | 61.42 | 61.42 | 61.53 |
| RealToxicityPrompts | 97.2 | 97.2 | 97.2 |
| TruthfulQA | 51.65 | 51.58 | 51.98 |
| CrowS | 35.42 | 35.48 | 35.42 |
| Spanish | Meta-Llama-3-8B-Instruct | Meta-Llama-3-8B-Instruct-GPTQ-8b | Meta-Llama-3-8B-Instruct-GPTQ |
| Avg. | 59 | 58.63 | 54.6 |
| ARC_es | 54.1 | 53.8 | 46.9 |
| Hellaswag_es | 63.8 | 63.3 | 60.3 |
| MMLU_es | 59.1 | 58.8 | 56.6 |
We did not check for data contamination.
Evaluation was done using Eval. Harness using limit=1000.
| requests/s | tokens/s | |
|---|---|---|
| NVIDIA L4x1 | 3.96 | 1887.55 |
| NVIDIA L4x2 | 4.87 | 2323.34 |
| NVIDIA L4x4 | 5.61 | 2674.18 |
| Performance measured on cortecs inference. |