Instructions to use BucketOfFish/simplified_phi2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BucketOfFish/simplified_phi2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BucketOfFish/simplified_phi2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BucketOfFish/simplified_phi2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BucketOfFish/simplified_phi2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BucketOfFish/simplified_phi2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BucketOfFish/simplified_phi2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BucketOfFish/simplified_phi2
- SGLang
How to use BucketOfFish/simplified_phi2 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 "BucketOfFish/simplified_phi2" \ --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": "BucketOfFish/simplified_phi2", "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 "BucketOfFish/simplified_phi2" \ --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": "BucketOfFish/simplified_phi2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BucketOfFish/simplified_phi2 with Docker Model Runner:
docker model run hf.co/BucketOfFish/simplified_phi2
Commit History
-
Got output to match Phi2 exactly
3649bbb -
Fixed inference script bug and made deterministic
4f25dda -
Passing KV cache through iterations
c07c430
-
Edited comments
455129a -
Added YAML to README
76e8ee6 -
Updated README
32d8f06 -
Corrected rotary embedding
df388cc -
Corrected param name
c572a14 -
Got model running, but results are incorrect
0f3418e -
Fixed weight loading from original Phi2 model
10aca20 -
Renaming state dict keys from Phi2
78f6f3b -
Updated imports in script
16cc769 -
Just uploading entire rewritten codebase at once
a420fe7 -
Another small fix
41127ee -
Rotary embedding correction
2380737 -
Simplified rotary embedding
3c52426 -
Removed all flash_attn usage
5e8c4af -
Revert "Removed non-flash configs"
This reverts commit 23b970edfa01c2df7460ba28d1142ddda7af2962.8a5eabe -
Revert "Removed non-flash classes"
This reverts commit 6be42f2bc584ea7d59e85502f1b8ccd538fe50e5.7c0c66d -
Removed non-flash configs
23b970e -
Removed non-flash classes
6be42f2 -
Removed output check
7da2fc9 -
Streaming inference script
dc6124b -
Copy of Phi2
89d375e