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
.ipynb_checkpoints/ort_config-checkpoint.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"one_external_file": true,
|
| 3 |
+
"opset": null,
|
| 4 |
+
"optimization": {},
|
| 5 |
+
"optimum_version": "1.11.0",
|
| 6 |
+
"quantization": {
|
| 7 |
+
"activations_dtype": "QUInt8",
|
| 8 |
+
"activations_symmetric": false,
|
| 9 |
+
"format": "QDQ",
|
| 10 |
+
"is_static": false,
|
| 11 |
+
"mode": "IntegerOps",
|
| 12 |
+
"nodes_to_exclude": [],
|
| 13 |
+
"nodes_to_quantize": [],
|
| 14 |
+
"operators_to_quantize": [
|
| 15 |
+
"Conv",
|
| 16 |
+
"MatMul",
|
| 17 |
+
"Attention",
|
| 18 |
+
"LSTM",
|
| 19 |
+
"Gather",
|
| 20 |
+
"Transpose",
|
| 21 |
+
"EmbedLayerNormalization"
|
| 22 |
+
],
|
| 23 |
+
"per_channel": true,
|
| 24 |
+
"qdq_add_pair_to_weight": false,
|
| 25 |
+
"qdq_dedicated_pair": false,
|
| 26 |
+
"qdq_op_type_per_channel_support_to_axis": {
|
| 27 |
+
"MatMul": 1
|
| 28 |
+
},
|
| 29 |
+
"reduce_range": false,
|
| 30 |
+
"weights_dtype": "QInt8",
|
| 31 |
+
"weights_symmetric": true
|
| 32 |
+
},
|
| 33 |
+
"transformers_version": "4.29.0.dev0",
|
| 34 |
+
"use_external_data_format": true
|
| 35 |
+
}
|
config.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
| 19 |
"rms_norm_eps": 1e-06,
|
| 20 |
"rope_scaling": null,
|
| 21 |
"tie_word_embeddings": false,
|
| 22 |
-
"
|
|
|
|
| 23 |
"use_cache": true,
|
| 24 |
"vocab_size": 32000
|
| 25 |
}
|
|
|
|
| 19 |
"rms_norm_eps": 1e-06,
|
| 20 |
"rope_scaling": null,
|
| 21 |
"tie_word_embeddings": false,
|
| 22 |
+
"torch_dtype": "float16",
|
| 23 |
+
"transformers_version": "4.29.0.dev0",
|
| 24 |
"use_cache": true,
|
| 25 |
"vocab_size": 32000
|
| 26 |
}
|
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:31d4a369f653d2a017d0d3dac65c323f5367451cfdac16caad96916ac2af10c7
|
| 3 |
+
size 19215765
|
onnx/decoder_model_merged_quantized.onnx_data
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6739214336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a31b5bc42d63e7f6f344b80b1ea79fb67c734a70ecf47bcdb76c0ed23d19543d
|
| 3 |
size 6739214336
|
onnx/ort_config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"one_external_file": true,
|
| 3 |
+
"opset": null,
|
| 4 |
+
"optimization": {},
|
| 5 |
+
"optimum_version": "1.11.0",
|
| 6 |
+
"quantization": {
|
| 7 |
+
"activations_dtype": "QUInt8",
|
| 8 |
+
"activations_symmetric": false,
|
| 9 |
+
"format": "QDQ",
|
| 10 |
+
"is_static": false,
|
| 11 |
+
"mode": "IntegerOps",
|
| 12 |
+
"nodes_to_exclude": [],
|
| 13 |
+
"nodes_to_quantize": [],
|
| 14 |
+
"operators_to_quantize": [
|
| 15 |
+
"Conv",
|
| 16 |
+
"MatMul",
|
| 17 |
+
"Attention",
|
| 18 |
+
"LSTM",
|
| 19 |
+
"Gather",
|
| 20 |
+
"Transpose",
|
| 21 |
+
"EmbedLayerNormalization"
|
| 22 |
+
],
|
| 23 |
+
"per_channel": true,
|
| 24 |
+
"qdq_add_pair_to_weight": false,
|
| 25 |
+
"qdq_dedicated_pair": false,
|
| 26 |
+
"qdq_op_type_per_channel_support_to_axis": {
|
| 27 |
+
"MatMul": 1
|
| 28 |
+
},
|
| 29 |
+
"reduce_range": false,
|
| 30 |
+
"weights_dtype": "QInt8",
|
| 31 |
+
"weights_symmetric": true
|
| 32 |
+
},
|
| 33 |
+
"transformers_version": "4.29.0.dev0",
|
| 34 |
+
"use_external_data_format": true
|
| 35 |
+
}
|