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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BucketOfFish/simplified_phi2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
| { | |
| "_name_or_path": "BucketOfFish/simplified_phi2", | |
| "architectures": [ | |
| "Phi2Model", | |
| "Phi2ModelForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "phi2_configuration.Phi2Config", | |
| "AutoModel": "phi2_model.Phi2Model", | |
| "AutoModelForCausalLM": "phi2_model.Phi2ModelForCausalLM" | |
| }, | |
| "model_type": "phi2", | |
| "torch_dtype": "float16", | |
| "transformers_version": "4.29.0", | |
| "vocab_size": 51200, | |
| "vocab_chunk_for_gpu_efficiency": 64, | |
| "initial_cos_sin_cache_len": 2048, | |
| "d_embedding": 2560, | |
| "n_attn_blocks": 32, | |
| "n_attn_heads": 32, | |
| "use_flash_attn": false, | |
| "use_flash_rotary": false, | |
| "use_fused_dense": false, | |
| "attn_pdrop": 0.0, | |
| "embd_pdrop": 0.0, | |
| "resid_pdrop": 0.1, | |
| "layer_norm_epsilon": 1e-05, | |
| "weight_initialization_range": 0.02, | |
| "tie_word_embeddings": false, | |
| "checkpointing": false | |
| } | |