Text Generation
Transformers
PyTorch
Safetensors
English
llama
conversational
text-generation-inference
Instructions to use pankajmathur/orca_mini_v8_0_70b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pankajmathur/orca_mini_v8_0_70b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pankajmathur/orca_mini_v8_0_70b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pankajmathur/orca_mini_v8_0_70b") model = AutoModelForCausalLM.from_pretrained("pankajmathur/orca_mini_v8_0_70b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pankajmathur/orca_mini_v8_0_70b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pankajmathur/orca_mini_v8_0_70b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pankajmathur/orca_mini_v8_0_70b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pankajmathur/orca_mini_v8_0_70b
- SGLang
How to use pankajmathur/orca_mini_v8_0_70b 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 "pankajmathur/orca_mini_v8_0_70b" \ --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": "pankajmathur/orca_mini_v8_0_70b", "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 "pankajmathur/orca_mini_v8_0_70b" \ --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": "pankajmathur/orca_mini_v8_0_70b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use pankajmathur/orca_mini_v8_0_70b with Docker Model Runner:
docker model run hf.co/pankajmathur/orca_mini_v8_0_70b
Update README.md
Browse files
README.md
CHANGED
|
@@ -39,7 +39,7 @@ Hello Orca Mini, what can you do for me?<|eot_id|>
|
|
| 39 |
<|start_header_id|>assistant<|end_header_id|>
|
| 40 |
```
|
| 41 |
|
| 42 |
-
Below shows a code example on how to use this model in default full precision (bf16) format, it requires
|
| 43 |
|
| 44 |
```python
|
| 45 |
import torch
|
|
@@ -59,7 +59,7 @@ outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.0
|
|
| 59 |
print(outputs[0]["generated_text"][-1])
|
| 60 |
```
|
| 61 |
|
| 62 |
-
Below shows a code example on how to use this model in
|
| 63 |
|
| 64 |
```python
|
| 65 |
import torch
|
|
@@ -87,6 +87,31 @@ print(outputs[0]["generated_text"][-1])
|
|
| 87 |
|
| 88 |
```
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
Below shows a code example on how to do a tool use with this model and tranformer library
|
| 91 |
|
| 92 |
Since **orca_mini_v8_0_70b** based upon LLaMA-3.3, it supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).
|
|
|
|
| 39 |
<|start_header_id|>assistant<|end_header_id|>
|
| 40 |
```
|
| 41 |
|
| 42 |
+
Below shows a code example on how to use this model in default full precision (bf16) format, it requires around ~130GB VRAM
|
| 43 |
|
| 44 |
```python
|
| 45 |
import torch
|
|
|
|
| 59 |
print(outputs[0]["generated_text"][-1])
|
| 60 |
```
|
| 61 |
|
| 62 |
+
Below shows a code example on how to use this model in 4-bit format via bitsandbytes library, it requires around ~39GB VRAM
|
| 63 |
|
| 64 |
```python
|
| 65 |
import torch
|
|
|
|
| 87 |
|
| 88 |
```
|
| 89 |
|
| 90 |
+
Below shows a code example on how to use this model in 8-bit format via bitsandbytes library, it requires around ~69GB VRAM
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
import torch
|
| 94 |
+
from transformers import BitsAndBytesConfig, pipeline
|
| 95 |
+
|
| 96 |
+
model_slug = "pankajmathur/orca_mini_v8_0_70b"
|
| 97 |
+
quantization_config = BitsAndBytesConfig(
|
| 98 |
+
load_in_8bit=True
|
| 99 |
+
)
|
| 100 |
+
pipeline = pipeline(
|
| 101 |
+
"text-generation",
|
| 102 |
+
model=model_slug,
|
| 103 |
+
model_kwargs={"quantization_config": quantization_config},
|
| 104 |
+
device_map="auto",
|
| 105 |
+
)
|
| 106 |
+
messages = [
|
| 107 |
+
{"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
|
| 108 |
+
{"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
|
| 109 |
+
]
|
| 110 |
+
outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
|
| 111 |
+
print(outputs[0]["generated_text"][-1])
|
| 112 |
+
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
Below shows a code example on how to do a tool use with this model and tranformer library
|
| 116 |
|
| 117 |
Since **orca_mini_v8_0_70b** based upon LLaMA-3.3, it supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).
|