Instructions to use relaxml/Llama-2-70b-E8P-2Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use relaxml/Llama-2-70b-E8P-2Bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="relaxml/Llama-2-70b-E8P-2Bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("relaxml/Llama-2-70b-E8P-2Bit") model = AutoModelForCausalLM.from_pretrained("relaxml/Llama-2-70b-E8P-2Bit") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use relaxml/Llama-2-70b-E8P-2Bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "relaxml/Llama-2-70b-E8P-2Bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "relaxml/Llama-2-70b-E8P-2Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/relaxml/Llama-2-70b-E8P-2Bit
- SGLang
How to use relaxml/Llama-2-70b-E8P-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 "relaxml/Llama-2-70b-E8P-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": "relaxml/Llama-2-70b-E8P-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 "relaxml/Llama-2-70b-E8P-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": "relaxml/Llama-2-70b-E8P-2Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use relaxml/Llama-2-70b-E8P-2Bit with Docker Model Runner:
docker model run hf.co/relaxml/Llama-2-70b-E8P-2Bit
Upload folder using huggingface_hub
#4
by at676 - opened
- config.json +4 -2
- generation_config.json +1 -1
- 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
CHANGED
|
@@ -4,6 +4,7 @@
|
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
|
|
|
| 7 |
"bos_token_id": 1,
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"hidden_act": "silu",
|
|
@@ -26,14 +27,15 @@
|
|
| 26 |
"model_version": 1,
|
| 27 |
"outlier_channel_split": false,
|
| 28 |
"packsz": 4,
|
| 29 |
-
"rescale_WH": false
|
|
|
|
| 30 |
},
|
| 31 |
"rms_norm_eps": 1e-05,
|
| 32 |
"rope_scaling": null,
|
| 33 |
"rope_theta": 10000.0,
|
| 34 |
"tie_word_embeddings": false,
|
| 35 |
"torch_dtype": "float16",
|
| 36 |
-
"transformers_version": "4.
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 32000
|
| 39 |
}
|
|
|
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"hidden_act": "silu",
|
|
|
|
| 27 |
"model_version": 1,
|
| 28 |
"outlier_channel_split": false,
|
| 29 |
"packsz": 4,
|
| 30 |
+
"rescale_WH": false,
|
| 31 |
+
"resid_scale_override": -1
|
| 32 |
},
|
| 33 |
"rms_norm_eps": 1e-05,
|
| 34 |
"rope_scaling": null,
|
| 35 |
"rope_theta": 10000.0,
|
| 36 |
"tie_word_embeddings": false,
|
| 37 |
"torch_dtype": "float16",
|
| 38 |
+
"transformers_version": "4.36.2",
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 32000
|
| 41 |
}
|
generation_config.json
CHANGED
|
@@ -6,5 +6,5 @@
|
|
| 6 |
"pad_token_id": 0,
|
| 7 |
"temperature": 0.6,
|
| 8 |
"top_p": 0.9,
|
| 9 |
-
"transformers_version": "4.
|
| 10 |
}
|
|
|
|
| 6 |
"pad_token_id": 0,
|
| 7 |
"temperature": 0.6,
|
| 8 |
"top_p": 0.9,
|
| 9 |
+
"transformers_version": "4.36.2"
|
| 10 |
}
|
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:614ed7f1a5c12d21f2d8149e2738e4bb26d6f2410ede66dd84138fdf57ac40ee
|
| 3 |
+
size 4964068056
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b523cabe0f6eebc29885c2a594f7da8ef59e7839c4c7ee04efff781e585039b
|
| 3 |
+
size 4985874080
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a5081b94724d83118bfeaeed307280ed31acf405091e4a67c78be1df3b7147d
|
| 3 |
+
size 4964866176
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31efb0f29baadadb0057e7158e3d7ce64d53f429742824be3f89767d3e8a9b88
|
| 3 |
+
size 3271337328
|
model.safetensors.index.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|