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
#1
by jc3464 - opened
- config.json +35 -0
- generation_config.json +10 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +0 -0
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "meta-llama/Llama-2-70b-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 8192,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 28672,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 64,
|
| 16 |
+
"num_hidden_layers": 80,
|
| 17 |
+
"num_key_value_heads": 8,
|
| 18 |
+
"pretraining_tp": 1,
|
| 19 |
+
"quip_params": {
|
| 20 |
+
"codebook": "E8P12",
|
| 21 |
+
"codesz": 8,
|
| 22 |
+
"idx_dtype": "torch.int16",
|
| 23 |
+
"lora_rank": 0,
|
| 24 |
+
"outlier_channel_split": false,
|
| 25 |
+
"rescale_WH": false
|
| 26 |
+
},
|
| 27 |
+
"rms_norm_eps": 1e-05,
|
| 28 |
+
"rope_scaling": null,
|
| 29 |
+
"rope_theta": 10000.0,
|
| 30 |
+
"tie_word_embeddings": false,
|
| 31 |
+
"torch_dtype": "float16",
|
| 32 |
+
"transformers_version": "4.34.0",
|
| 33 |
+
"use_cache": true,
|
| 34 |
+
"vocab_size": 32000
|
| 35 |
+
}
|
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.34.0"
|
| 10 |
+
}
|
model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d21fa61b8d2b8d4b8125ce958c6ab034185615ab8280aa3a451e07c18a47fee6
|
| 3 |
+
size 9987779322
|
model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:105e334872c6446ac11129ebb89cf1e839c5939f7ec0c84f878552b148d766bb
|
| 3 |
+
size 8198397262
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|