Instructions to use SkunkworksAI/phi-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SkunkworksAI/phi-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SkunkworksAI/phi-2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SkunkworksAI/phi-2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SkunkworksAI/phi-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SkunkworksAI/phi-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SkunkworksAI/phi-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SkunkworksAI/phi-2
- SGLang
How to use SkunkworksAI/phi-2 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 "SkunkworksAI/phi-2" \ --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": "SkunkworksAI/phi-2", "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 "SkunkworksAI/phi-2" \ --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": "SkunkworksAI/phi-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SkunkworksAI/phi-2 with Docker Model Runner:
docker model run hf.co/SkunkworksAI/phi-2
Commit History
-
Update README.md
633bb65 -
Update README.md
2fbb425 -
Update README.md
858d90f -
Add safetensors (#9)
- Add safetensors (511b69b040b1df6a761950a7c5562bc313431c5a) Co-authored-by: J Bochi <jbochi@users.noreply.huggingface.co>a74210b -
Update README.md
6c49320 -
Update README.md
b5d96a7 -
Update config.json
120f978 -
Rename model_mixformer_sequential.py to modeling_mixformer_sequential.py
ba5e497 -
Update config.json (#7)
- Update config.json (c9f5af792ef00942fce8925edb6ac76524b8a40d) Co-authored-by: wang <zhaokai@users.noreply.huggingface.co>5ce1569 -
moved all to root for hf transformers
37c6959 -
moved all files and configs to root for hf transformers
e91643d -
moved model.bin files to correct folder
8c4e9fd -
Upload pytorch_model-00001-of-00002.bin (#4)
- Upload pytorch_model-00001-of-00002.bin (671b550f9fe8353f49e024030e2517fff52a50d3)252caf1 -
Upload pytorch_model-00002-of-00002.bin (#2)
- Upload pytorch_model-00002-of-00002.bin (bdf0f38c345ea8013178bd8aaddad0d722a71bdb) Co-authored-by: nisten <nisten@users.noreply.huggingface.co>ef089c5 -
Update README.md
f315165 -
Upload 15 files
503dc31 -
Update README.md
c100b91 -
Upload 6 files
fb05ee1 -
initial commit
Farouk69298e1