Text Generation
Transformers
Safetensors
llama
gsq
gumbel-softmax
quantization
ptq
llama-3.1
vllm
humming
conversational
text-generation-inference
Instructions to use ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ") model = AutoModelForCausalLM.from_pretrained("ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ") 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
- vLLM
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ
- SGLang
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ 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 "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ" \ --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": "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ", "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 "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ" \ --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": "ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ with Docker Model Runner:
docker model run hf.co/ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ
Add humming instructions
Browse files
README.md
CHANGED
|
@@ -71,10 +71,9 @@ weight is `3 bits (packed) + 16 bits / 128 (group scale) ≈ 3.13 bpp`. The
|
|
| 71 |
}
|
| 72 |
```
|
| 73 |
|
| 74 |
-
Loading this checkpoint requires
|
| 75 |
-
[`humming`](https://github.com/inclusionAI/humming)
|
| 76 |
-
|
| 77 |
-
exact install line).
|
| 78 |
|
| 79 |
> Note: GSQ training first writes shards in `compressed-tensors`
|
| 80 |
> `pack-quantized` format (where a 3-bit codebook is padded into a 4-bit
|
|
@@ -85,6 +84,12 @@ exact install line).
|
|
| 85 |
|
| 86 |
## Serving with vLLM
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
```bash
|
| 89 |
vllm serve ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ \
|
| 90 |
--tensor-parallel-size 2
|
|
|
|
| 71 |
}
|
| 72 |
```
|
| 73 |
|
| 74 |
+
Loading this checkpoint requires vLLM plus the
|
| 75 |
+
[`humming`](https://github.com/inclusionAI/humming) kernels (`pip install
|
| 76 |
+
humming-kernels`). See **Serving with vLLM** below.
|
|
|
|
| 77 |
|
| 78 |
> Note: GSQ training first writes shards in `compressed-tensors`
|
| 79 |
> `pack-quantized` format (where a 3-bit codebook is padded into a 4-bit
|
|
|
|
| 84 |
|
| 85 |
## Serving with vLLM
|
| 86 |
|
| 87 |
+
Install the Humming kernels (required for vLLM to load this checkpoint):
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
pip install humming-kernels
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
```bash
|
| 94 |
vllm serve ISTA-DASLab/Llama-3.1-70B-Instruct-3Bit-GSQ \
|
| 95 |
--tensor-parallel-size 2
|