Instructions to use relaxml/Llama-2-7b-E8PRVQ-4Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use relaxml/Llama-2-7b-E8PRVQ-4Bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="relaxml/Llama-2-7b-E8PRVQ-4Bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("relaxml/Llama-2-7b-E8PRVQ-4Bit") model = AutoModelForCausalLM.from_pretrained("relaxml/Llama-2-7b-E8PRVQ-4Bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use relaxml/Llama-2-7b-E8PRVQ-4Bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "relaxml/Llama-2-7b-E8PRVQ-4Bit" # 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-7b-E8PRVQ-4Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/relaxml/Llama-2-7b-E8PRVQ-4Bit
- SGLang
How to use relaxml/Llama-2-7b-E8PRVQ-4Bit 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-7b-E8PRVQ-4Bit" \ --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-7b-E8PRVQ-4Bit", "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-7b-E8PRVQ-4Bit" \ --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-7b-E8PRVQ-4Bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use relaxml/Llama-2-7b-E8PRVQ-4Bit with Docker Model Runner:
docker model run hf.co/relaxml/Llama-2-7b-E8PRVQ-4Bit
Upload folder using huggingface_hub (#2)
Browse files- cb5989f4a0ea1835c0bf936643ba4197f2d1c2bcefce80a0923507aebe3f8eb3 (aca6a8beda8f2942d8496988deeafb6bc78b3e1c)
- a2e0bf284adb7805f103e4e59f518580f75b4981446e3db61787224fe8aa0fbb (e3586d9578bf7dbb516ca0ee78848bf91e8d842e)
- config.json +2 -1
- generation_config.json +1 -1
- model.safetensors +1 -1
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",
|
|
@@ -34,7 +35,7 @@
|
|
| 34 |
"rope_theta": 10000.0,
|
| 35 |
"tie_word_embeddings": false,
|
| 36 |
"torch_dtype": "float16",
|
| 37 |
-
"transformers_version": "4.
|
| 38 |
"use_cache": true,
|
| 39 |
"vocab_size": 32000
|
| 40 |
}
|
|
|
|
| 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",
|
|
|
|
| 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.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3767120584
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:faf646d16945d2eedfda47670a995f1e4de98bf73022fa73739708239c28aa82
|
| 3 |
size 3767120584
|