Text Generation
Transformers
Safetensors
llama
quantization
harp
2-bit
extreme-quantization
text-generation-inference
Instructions to use brain-lab/Llama-2-70b-QuIP-HARP-2Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brain-lab/Llama-2-70b-QuIP-HARP-2Bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="brain-lab/Llama-2-70b-QuIP-HARP-2Bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("brain-lab/Llama-2-70b-QuIP-HARP-2Bit") model = AutoModelForCausalLM.from_pretrained("brain-lab/Llama-2-70b-QuIP-HARP-2Bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use brain-lab/Llama-2-70b-QuIP-HARP-2Bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "brain-lab/Llama-2-70b-QuIP-HARP-2Bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brain-lab/Llama-2-70b-QuIP-HARP-2Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/brain-lab/Llama-2-70b-QuIP-HARP-2Bit
- SGLang
How to use brain-lab/Llama-2-70b-QuIP-HARP-2Bit 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 "brain-lab/Llama-2-70b-QuIP-HARP-2Bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brain-lab/Llama-2-70b-QuIP-HARP-2Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "brain-lab/Llama-2-70b-QuIP-HARP-2Bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brain-lab/Llama-2-70b-QuIP-HARP-2Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use brain-lab/Llama-2-70b-QuIP-HARP-2Bit with Docker Model Runner:
docker model run hf.co/brain-lab/Llama-2-70b-QuIP-HARP-2Bit
Upload folder using huggingface_hub
Browse files- config.json +66 -0
- generation_config.json +10 -0
- model-00001-of-00004.safetensors +3 -0
- model-00002-of-00004.safetensors +3 -0
- model-00003-of-00004.safetensors +3 -0
- model-00004-of-00004.safetensors +3 -0
- model.safetensors.index.json +0 -0
config.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "meta-llama/Llama-2-70b-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 8192,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 28672,
|
| 15 |
+
"max_position_embeddings": 4096,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 64,
|
| 19 |
+
"num_hidden_layers": 80,
|
| 20 |
+
"num_key_value_heads": 8,
|
| 21 |
+
"pretraining_tp": 1,
|
| 22 |
+
"quip_params": {
|
| 23 |
+
"codebook": "E8P12",
|
| 24 |
+
"codebook_version": 1,
|
| 25 |
+
"codesz": 8,
|
| 26 |
+
"harp": {
|
| 27 |
+
"chunk_size": 1048576,
|
| 28 |
+
"early_stop_min_rel_improve": 0.01,
|
| 29 |
+
"early_stop_window": 0,
|
| 30 |
+
"fixed_mixer": "had_or_qr",
|
| 31 |
+
"grad_clip": null,
|
| 32 |
+
"harp_b": 8,
|
| 33 |
+
"harp_max_b": 8,
|
| 34 |
+
"harp_passes": 1,
|
| 35 |
+
"hbd_block": 8,
|
| 36 |
+
"hbd_lambda": 0.1,
|
| 37 |
+
"kron_fallback": false,
|
| 38 |
+
"lr_u": 0.03,
|
| 39 |
+
"lr_v": 0.03,
|
| 40 |
+
"ordering_mode": "stride",
|
| 41 |
+
"q_recompute_every": 1,
|
| 42 |
+
"reg_theta": 0.0,
|
| 43 |
+
"steps": 1200,
|
| 44 |
+
"strategy": "proxy",
|
| 45 |
+
"theta_clip": null,
|
| 46 |
+
"theta_init_scale": 0.0,
|
| 47 |
+
"use_givens_b2": false
|
| 48 |
+
},
|
| 49 |
+
"idx_dtype": "torch.int64",
|
| 50 |
+
"incoh_mode": "harp",
|
| 51 |
+
"lora_rank": 0,
|
| 52 |
+
"model_version": 1,
|
| 53 |
+
"packsz": 4,
|
| 54 |
+
"quant_layers": null,
|
| 55 |
+
"rescale_WH": false,
|
| 56 |
+
"resid_scale_override": -1
|
| 57 |
+
},
|
| 58 |
+
"rms_norm_eps": 1e-05,
|
| 59 |
+
"rope_scaling": null,
|
| 60 |
+
"rope_theta": 10000.0,
|
| 61 |
+
"tie_word_embeddings": false,
|
| 62 |
+
"torch_dtype": "float16",
|
| 63 |
+
"transformers_version": "4.45.2",
|
| 64 |
+
"use_cache": true,
|
| 65 |
+
"vocab_size": 32000
|
| 66 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 1,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"max_length": 4096,
|
| 6 |
+
"pad_token_id": 0,
|
| 7 |
+
"temperature": 0.6,
|
| 8 |
+
"top_p": 0.9,
|
| 9 |
+
"transformers_version": "4.45.2"
|
| 10 |
+
}
|
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29d9bec047cb8e61500903c0f40235f4f9764d84681bea64b65b9354390bc4b4
|
| 3 |
+
size 4999938836
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5601ddb83a84bacdb9354229e25f15bb923603d78cdd0307a32a54b825c2efdb
|
| 3 |
+
size 4999656996
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7e52298bdac66bb3e76f0b36749d2d218b155841264e48d5c1af11b64d053b8
|
| 3 |
+
size 4998854180
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc02cd763686b5ab14c7f2ee9a5538960ac813830ce35d26f53db4beffd2414f
|
| 3 |
+
size 4220701348
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|