Text Generation
Transformers
Safetensors
llama
int8
vllm
conversational
text-generation-inference
compressed-tensors
Instructions to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16") model = AutoModelForCausalLM.from_pretrained("RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16
- SGLang
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16" \ --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": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16" \ --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": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16 with Docker Model Runner:
docker model run hf.co/RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a16
Update README.md
Browse files
README.md
CHANGED
|
@@ -143,7 +143,7 @@ This version of the lm-evaluation-harness includes versions of MMLU, ARC-Challen
|
|
| 143 |
</td>
|
| 144 |
<td><strong>Meta-Llama-3.1-8B-Instruct </strong>
|
| 145 |
</td>
|
| 146 |
-
<td><strong>Meta-Llama-3.1-8B-Instruct-quantized.
|
| 147 |
</td>
|
| 148 |
<td><strong>Recovery</strong>
|
| 149 |
</td>
|
|
@@ -350,7 +350,7 @@ lm_eval \
|
|
| 350 |
```
|
| 351 |
lm_eval \
|
| 352 |
--model vllm \
|
| 353 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 354 |
--tasks mmlu_pt_llama_3.1_instruct \
|
| 355 |
--fewshot_as_multiturn \
|
| 356 |
--apply_chat_template \
|
|
@@ -362,7 +362,7 @@ lm_eval \
|
|
| 362 |
```
|
| 363 |
lm_eval \
|
| 364 |
--model vllm \
|
| 365 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 366 |
--tasks mmlu_es_llama_3.1_instruct \
|
| 367 |
--fewshot_as_multiturn \
|
| 368 |
--apply_chat_template \
|
|
@@ -374,7 +374,7 @@ lm_eval \
|
|
| 374 |
```
|
| 375 |
lm_eval \
|
| 376 |
--model vllm \
|
| 377 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 378 |
--tasks mmlu_it_llama_3.1_instruct \
|
| 379 |
--fewshot_as_multiturn \
|
| 380 |
--apply_chat_template \
|
|
@@ -386,7 +386,7 @@ lm_eval \
|
|
| 386 |
```
|
| 387 |
lm_eval \
|
| 388 |
--model vllm \
|
| 389 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 390 |
--tasks mmlu_de_llama_3.1_instruct \
|
| 391 |
--fewshot_as_multiturn \
|
| 392 |
--apply_chat_template \
|
|
@@ -398,7 +398,7 @@ lm_eval \
|
|
| 398 |
```
|
| 399 |
lm_eval \
|
| 400 |
--model vllm \
|
| 401 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 402 |
--tasks mmlu_fr_llama_3.1_instruct \
|
| 403 |
--fewshot_as_multiturn \
|
| 404 |
--apply_chat_template \
|
|
@@ -410,7 +410,7 @@ lm_eval \
|
|
| 410 |
```
|
| 411 |
lm_eval \
|
| 412 |
--model vllm \
|
| 413 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 414 |
--tasks mmlu_hi_llama_3.1_instruct \
|
| 415 |
--fewshot_as_multiturn \
|
| 416 |
--apply_chat_template \
|
|
@@ -422,7 +422,7 @@ lm_eval \
|
|
| 422 |
```
|
| 423 |
lm_eval \
|
| 424 |
--model vllm \
|
| 425 |
-
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.
|
| 426 |
--tasks mmlu_th_llama_3.1_instruct \
|
| 427 |
--fewshot_as_multiturn \
|
| 428 |
--apply_chat_template \
|
|
|
|
| 143 |
</td>
|
| 144 |
<td><strong>Meta-Llama-3.1-8B-Instruct </strong>
|
| 145 |
</td>
|
| 146 |
+
<td><strong>Meta-Llama-3.1-8B-Instruct-quantized.w8a16 (this model)</strong>
|
| 147 |
</td>
|
| 148 |
<td><strong>Recovery</strong>
|
| 149 |
</td>
|
|
|
|
| 350 |
```
|
| 351 |
lm_eval \
|
| 352 |
--model vllm \
|
| 353 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 354 |
--tasks mmlu_pt_llama_3.1_instruct \
|
| 355 |
--fewshot_as_multiturn \
|
| 356 |
--apply_chat_template \
|
|
|
|
| 362 |
```
|
| 363 |
lm_eval \
|
| 364 |
--model vllm \
|
| 365 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 366 |
--tasks mmlu_es_llama_3.1_instruct \
|
| 367 |
--fewshot_as_multiturn \
|
| 368 |
--apply_chat_template \
|
|
|
|
| 374 |
```
|
| 375 |
lm_eval \
|
| 376 |
--model vllm \
|
| 377 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 378 |
--tasks mmlu_it_llama_3.1_instruct \
|
| 379 |
--fewshot_as_multiturn \
|
| 380 |
--apply_chat_template \
|
|
|
|
| 386 |
```
|
| 387 |
lm_eval \
|
| 388 |
--model vllm \
|
| 389 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 390 |
--tasks mmlu_de_llama_3.1_instruct \
|
| 391 |
--fewshot_as_multiturn \
|
| 392 |
--apply_chat_template \
|
|
|
|
| 398 |
```
|
| 399 |
lm_eval \
|
| 400 |
--model vllm \
|
| 401 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 402 |
--tasks mmlu_fr_llama_3.1_instruct \
|
| 403 |
--fewshot_as_multiturn \
|
| 404 |
--apply_chat_template \
|
|
|
|
| 410 |
```
|
| 411 |
lm_eval \
|
| 412 |
--model vllm \
|
| 413 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 414 |
--tasks mmlu_hi_llama_3.1_instruct \
|
| 415 |
--fewshot_as_multiturn \
|
| 416 |
--apply_chat_template \
|
|
|
|
| 422 |
```
|
| 423 |
lm_eval \
|
| 424 |
--model vllm \
|
| 425 |
+
--model_args pretrained="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a16",dtype=auto,max_model_len=3850,max_gen_toks=10,tensor_parallel_size=1 \
|
| 426 |
--tasks mmlu_th_llama_3.1_instruct \
|
| 427 |
--fewshot_as_multiturn \
|
| 428 |
--apply_chat_template \
|