Instructions to use dphn/dolphin-2.9.2-Phi-3-Medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dphn/dolphin-2.9.2-Phi-3-Medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dphn/dolphin-2.9.2-Phi-3-Medium") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dphn/dolphin-2.9.2-Phi-3-Medium") model = AutoModelForCausalLM.from_pretrained("dphn/dolphin-2.9.2-Phi-3-Medium", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dphn/dolphin-2.9.2-Phi-3-Medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dphn/dolphin-2.9.2-Phi-3-Medium" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dphn/dolphin-2.9.2-Phi-3-Medium", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dphn/dolphin-2.9.2-Phi-3-Medium
- SGLang
How to use dphn/dolphin-2.9.2-Phi-3-Medium 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 "dphn/dolphin-2.9.2-Phi-3-Medium" \ --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": "dphn/dolphin-2.9.2-Phi-3-Medium", "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 "dphn/dolphin-2.9.2-Phi-3-Medium" \ --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": "dphn/dolphin-2.9.2-Phi-3-Medium", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dphn/dolphin-2.9.2-Phi-3-Medium with Docker Model Runner:
docker model run hf.co/dphn/dolphin-2.9.2-Phi-3-Medium
| license: mit | |
| language: | |
| - en | |
| base_model: | |
| - unsloth/Phi-3-mini-4k-instruct | |
| datasets: | |
| - cognitivecomputations/Dolphin-2.9.2 | |
| - teknium/OpenHermes-2.5 | |
| - m-a-p/CodeFeedback-Filtered-Instruction | |
| - cognitivecomputations/dolphin-coder | |
| - cognitivecomputations/samantha-data | |
| - microsoft/orca-math-word-problems-200k | |
| - internlm/Agent-FLAN | |
| - cognitivecomputations/SystemChat-2.0 | |
| # Dolphin 2.9.2 Phi 3 Medium 🐬 | |
| Curated and trained by Eric Hartford, Lucas Atkins, Fernando Fernandes, and with help from the community of Cognitive Computations | |
| [](https://discord.gg/cognitivecomputations) | |
| Discord: https://discord.gg/cognitivecomputations | |
| <img src="https://cdn-uploads.huggingface.co/production/uploads/63111b2d88942700629f5771/ldkN1J0WIDQwU4vutGYiD.png" width="600" /> | |
| Our appreciation for the sponsor of Dolphin 2.9.2: | |
| - [Crusoe Cloud](https://crusoe.ai/) - provided excellent on-demand 8xL40Snode | |
| This model is based on Phi-3-Medium-Instruct-4k, and is governed by the MIT license with which Microsoft released Phi-3. | |
| Since Microsoft only released the fine-tuned model - Dolphin-2.9.2-Phi-3-Medium has not been entirely cleaned of refusals. | |
| The base model has 4k context, and the qLoRA fine-tuning was with 4k sequence length. | |
| It took 3.5 days on 8xL40S node provided by Crusoe Cloud | |
| This model uses the ChatML prompt template. | |
| example: | |
| ``` | |
| <|im_start|>system | |
| You are Dolphin, a helpful AI assistant.<|im_end|> | |
| <|im_start|>user | |
| {prompt}<|im_end|> | |
| <|im_start|>assistant | |
| ``` | |
| Dolphin-2.9.2 has a variety of instruction, conversational, and coding skills. It also has initial agentic abilities and supports function calling. | |
| We have filtered the dataset to remove alignment and bias. This makes the model more compliant. You are advised to implement your own alignment layer before exposing the model as a service. Please read my blog post about uncensored models. https://erichartford.com/uncensored-models You are responsible for any content you create using this model. Enjoy responsibly. | |
|  | |
| [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl) | |
| ## evals: | |
| <img src="https://i.ibb.co/jrBsPLY/file-9gw-A1-Ih-SBYU3-PCZ92-ZNb-Vci-P.png" width="600" /> |