Text Generation
Transformers
ONNX
English
llama
facebook
meta
llama-2
ONNX
DirectML
DML
conversational
ONNXRuntime
custom_code
Instructions to use EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml
- SGLang
How to use EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml 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 "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml with Docker Model Runner:
docker model run hf.co/EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml
Update README.md
Browse files
README.md
CHANGED
|
@@ -26,7 +26,7 @@ conda activate onnx
|
|
| 26 |
winget install -e --id GitHub.GitLFS
|
| 27 |
pip install huggingface-hub[cli]
|
| 28 |
huggingface-cli download EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml --local-dir .\llama-2-13b-chat
|
| 29 |
-
pip install numpy
|
| 30 |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi3-qa.py" -OutFile "phi3-qa.py"
|
| 31 |
pip install onnxruntime-directml
|
| 32 |
pip install --pre onnxruntime-genai-directml
|
|
|
|
| 26 |
winget install -e --id GitHub.GitLFS
|
| 27 |
pip install huggingface-hub[cli]
|
| 28 |
huggingface-cli download EmbeddedLLM/llama-2-13b-chat-int4-onnx-directml --local-dir .\llama-2-13b-chat
|
| 29 |
+
pip install numpy==1.26.4
|
| 30 |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi3-qa.py" -OutFile "phi3-qa.py"
|
| 31 |
pip install onnxruntime-directml
|
| 32 |
pip install --pre onnxruntime-genai-directml
|