Instructions to use onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX") model = AutoModelForCausalLM.from_pretrained("onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX
- SGLang
How to use onnx-community/Llama-3.2-3B-Instruct-GENAI-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 "onnx-community/Llama-3.2-3B-Instruct-GENAI-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": "onnx-community/Llama-3.2-3B-Instruct-GENAI-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 "onnx-community/Llama-3.2-3B-Instruct-GENAI-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": "onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX with Docker Model Runner:
docker model run hf.co/onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX
Update README.md
Browse files
README.md
CHANGED
|
@@ -77,6 +77,7 @@ Minimum Configuration Required:
|
|
| 77 |
- **Model type:** ONNX
|
| 78 |
- **Language(s) (NLP):** Python, C, C++
|
| 79 |
- **License:** MIT
|
|
|
|
| 80 |
- **Model Description:** This is a conversion of the Llama 3.2 model for ONNX Runtime inference.
|
| 81 |
- **Disclaimer:** Model is only an optimization of the base model, any risk associated with the model is the responsibility of the user of the model. Please verify and test for you scenarios. There may be a slight difference in output from the base model with the optimizations applied. **
|
| 82 |
|
|
@@ -105,4 +106,7 @@ This joke plays on the double meaning of "make up." In science, atoms are the fu
|
|
| 105 |
|
| 106 |
|
| 107 |
## Base Model Information
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
- **Model type:** ONNX
|
| 78 |
- **Language(s) (NLP):** Python, C, C++
|
| 79 |
- **License:** MIT
|
| 80 |
+
- **License:** Use of Llama 3.2 is governed by the [Llama 3.2 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/LICENSE) (a custom, commercial license agreement).
|
| 81 |
- **Model Description:** This is a conversion of the Llama 3.2 model for ONNX Runtime inference.
|
| 82 |
- **Disclaimer:** Model is only an optimization of the base model, any risk associated with the model is the responsibility of the user of the model. Please verify and test for you scenarios. There may be a slight difference in output from the base model with the optimizations applied. **
|
| 83 |
|
|
|
|
| 106 |
|
| 107 |
|
| 108 |
## Base Model Information
|
| 109 |
+
"See Meta's model card
|
| 110 |
+
[Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct)
|
| 111 |
+
for more information about the base model, including the base model's specific approach to responsible AI risks"
|
| 112 |
+
|