Instructions to use Open-Orca/OpenOrcaxOpenChat-Preview2-13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Open-Orca/OpenOrcaxOpenChat-Preview2-13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Open-Orca/OpenOrcaxOpenChat-Preview2-13B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Open-Orca/OpenOrcaxOpenChat-Preview2-13B") model = AutoModelForCausalLM.from_pretrained("Open-Orca/OpenOrcaxOpenChat-Preview2-13B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Open-Orca/OpenOrcaxOpenChat-Preview2-13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Open-Orca/OpenOrcaxOpenChat-Preview2-13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Open-Orca/OpenOrcaxOpenChat-Preview2-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B
- SGLang
How to use Open-Orca/OpenOrcaxOpenChat-Preview2-13B 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 "Open-Orca/OpenOrcaxOpenChat-Preview2-13B" \ --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": "Open-Orca/OpenOrcaxOpenChat-Preview2-13B", "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 "Open-Orca/OpenOrcaxOpenChat-Preview2-13B" \ --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": "Open-Orca/OpenOrcaxOpenChat-Preview2-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Open-Orca/OpenOrcaxOpenChat-Preview2-13B with Docker Model Runner:
docker model run hf.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B
Prompt template discrepancy
The examples you give have <|end_of_turn|> as the only separator between user and assistant message, without any newlines:
User: Hello<|end_of_turn|>Assistant: Hi<|end_of_turn|>User: How are you today?<|end_of_turn|>Assistant:
But further down the page, your ooba prompt template has a newline after the seperator and also after the assistant message:
<|user|> <|user-message|><|end_of_turn|>\n<|bot|> <|bot-message|>\n
So which is correct? And where, and how, is the "context" you give for ooba supposed to go in the prompt (I assume it's the system message)?
There are still some bugs in the way different inference engines process tokens. The way the model was trained, the newline characters shouldn't be necessary, but they also shouldn't hurt.
We've found that in some cases including them can reduce the chances of unexpected behavior.
So try without newlines if you're token-budget-conscious. If you find any unusual behavior (e.g. not stopping inference when done outputting, or the model starting to have a conversation with itself), try inserting them.
Note: The space after "User:" (so this "User: " not this "User:") and "Assistant: " will also help avoid inference bugs, and are also part of the training regimen, so should in all circumstances be included.
Thanks for the explanation. Just noticed another discrepancy:
What about the <|end_of_turn|> itself? In the first example there's one after every message, both user and assistant, whereas in the ooba example, there's only one after the user message, but none after the bot message, just a linebreak.
The model should generate the end of turn token when it is done responding to the prompt.
OK. So when inference software catches that as a stop token and removes it before returning the output, it makes sense that we add it into the prompt for the next round of inference.