Instructions to use steerapi/Llama-2-7b-chat-hf-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use steerapi/Llama-2-7b-chat-hf-onnx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="steerapi/Llama-2-7b-chat-hf-onnx")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("steerapi/Llama-2-7b-chat-hf-onnx") model = AutoModelForCausalLM.from_pretrained("steerapi/Llama-2-7b-chat-hf-onnx", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use steerapi/Llama-2-7b-chat-hf-onnx with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "steerapi/Llama-2-7b-chat-hf-onnx" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "steerapi/Llama-2-7b-chat-hf-onnx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/steerapi/Llama-2-7b-chat-hf-onnx
- SGLang
How to use steerapi/Llama-2-7b-chat-hf-onnx 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 "steerapi/Llama-2-7b-chat-hf-onnx" \ --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": "steerapi/Llama-2-7b-chat-hf-onnx", "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 "steerapi/Llama-2-7b-chat-hf-onnx" \ --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": "steerapi/Llama-2-7b-chat-hf-onnx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use steerapi/Llama-2-7b-chat-hf-onnx with Docker Model Runner:
docker model run hf.co/steerapi/Llama-2-7b-chat-hf-onnx
Upload folder using huggingface_hub
Browse files
.gitattributes
CHANGED
|
@@ -45,3 +45,4 @@ onnx/q1/decoder_model_merged_quantized.onnx.data filter=lfs diff=lfs merge=lfs -
|
|
| 45 |
onnx/decoder_model_merged_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 46 |
onnx/decoder_model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 47 |
onnx/decoder_with_past_model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 45 |
onnx/decoder_model_merged_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 46 |
onnx/decoder_model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 47 |
onnx/decoder_with_past_model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
onnx/decoder_model_merged_quantized.onnx_data filter=lfs diff=lfs merge=lfs -text
|
onnx/decoder_model_merged_quantized.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:210c6485f34cc1c35daa38072b29cb540c7dc7c04326cfd5b81c1429368398e3
|
| 3 |
+
size 19045741
|
onnx/decoder_model_merged_quantized.onnx_data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d312201a36ec7d97cac2fc87c664ef0ec16a681f55ec013b9e3ce383904411e4
|
| 3 |
+
size 6739214336
|
onnx/quantize_config.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
{
|
| 2 |
-
"per_channel":
|
| 3 |
-
"reduce_range":
|
| 4 |
"use_external_data_format": true,
|
| 5 |
"per_model_config": {
|
| 6 |
"decoder_model_merged": {
|
| 7 |
"op_types": [
|
| 8 |
-
"
|
| 9 |
-
"
|
|
|
|
| 10 |
"If",
|
| 11 |
"Shape",
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"Pow",
|
| 15 |
"Sub",
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"Constant",
|
| 21 |
"Equal",
|
| 22 |
-
"Sqrt",
|
| 23 |
-
"Expand",
|
| 24 |
"Add",
|
| 25 |
-
"
|
| 26 |
-
"
|
|
|
|
| 27 |
"Div",
|
| 28 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"Where",
|
| 30 |
-
"Transpose",
|
| 31 |
"Mul",
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"Reshape"
|
| 37 |
],
|
| 38 |
"weight_type": "QInt8"
|
| 39 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"per_channel": true,
|
| 3 |
+
"reduce_range": true,
|
| 4 |
"use_external_data_format": true,
|
| 5 |
"per_model_config": {
|
| 6 |
"decoder_model_merged": {
|
| 7 |
"op_types": [
|
| 8 |
+
"Slice",
|
| 9 |
+
"Sqrt",
|
| 10 |
+
"Less",
|
| 11 |
"If",
|
| 12 |
"Shape",
|
| 13 |
+
"Transpose",
|
| 14 |
+
"Range",
|
|
|
|
| 15 |
"Sub",
|
| 16 |
+
"Concat",
|
| 17 |
+
"Squeeze",
|
| 18 |
+
"Cast",
|
| 19 |
+
"Neg",
|
|
|
|
| 20 |
"Equal",
|
|
|
|
|
|
|
| 21 |
"Add",
|
| 22 |
+
"Pow",
|
| 23 |
+
"Reshape",
|
| 24 |
+
"Identity",
|
| 25 |
"Div",
|
| 26 |
+
"Constant",
|
| 27 |
+
"Gather",
|
| 28 |
+
"Softmax",
|
| 29 |
+
"Sigmoid",
|
| 30 |
+
"ReduceMean",
|
| 31 |
"Where",
|
|
|
|
| 32 |
"Mul",
|
| 33 |
+
"Expand",
|
| 34 |
+
"MatMul",
|
| 35 |
+
"Unsqueeze",
|
| 36 |
+
"ConstantOfShape"
|
|
|
|
| 37 |
],
|
| 38 |
"weight_type": "QInt8"
|
| 39 |
}
|