Instructions to use microsoft/Phi-3-small-128k-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Phi-3-small-128k-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/Phi-3-small-128k-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-small-128k-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use microsoft/Phi-3-small-128k-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/Phi-3-small-128k-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/Phi-3-small-128k-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/microsoft/Phi-3-small-128k-instruct
- SGLang
How to use microsoft/Phi-3-small-128k-instruct 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 "microsoft/Phi-3-small-128k-instruct" \ --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": "microsoft/Phi-3-small-128k-instruct", "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 "microsoft/Phi-3-small-128k-instruct" \ --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": "microsoft/Phi-3-small-128k-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use microsoft/Phi-3-small-128k-instruct with Docker Model Runner:
docker model run hf.co/microsoft/Phi-3-small-128k-instruct
Phi-3-small-128k-instruct-onnx-cuda
#40 opened 5 months ago
by
Andreas999
Upgrade to a newer transformers version
#39 opened 6 months ago
by
the-mysh
Phi-3-small-128k-instruct-coding-ensemble-mcettrick
#38 opened 9 months ago
by
mcettrick-ai
add AIBOM
#36 opened 11 months ago
by
sabato-nocera
Improve model card: Add library name
#35 opened about 1 year ago
by
nielsr
Error in Flash Attention
#34 opened over 1 year ago
by
Sayan01
Resolve - 196 [rank0]: triton.runtime.autotuner.OutOfResources: out of resource: shared memory, Required: 180224, Hardware limit: 101376. Reducing block sizes or `num_stages` may help.
1
#33 opened over 1 year ago
by
moidhassan
Issue with Rope Scaling
1
#31 opened almost 2 years ago
by
ritwickchaudhryamazon
AssertionError: Flash Attention is not available, but is needed for dense attention
4
#30 opened almost 2 years ago
by
tpadhi1
Fast Tokenization for Phi3-small
#29 opened almost 2 years ago
by
mfajcik
update positional_embedding.py
#28 opened almost 2 years ago
by
mwirth-epo
"OutOfResources: out of resource: shared memory, Required: 180224, Hardware limit: 101376. "
1
#27 opened almost 2 years ago
by
joker26
Slower generation with multi-batch size.
#26 opened almost 2 years ago
by
Satandon1999
why only small model use MuP ?
#24 opened almost 2 years ago
by
xdseunghyun
tokenizer gives unexpected results
#23 opened almost 2 years ago
by
jpiabrantes
Does it support system?
#22 opened almost 2 years ago
by
lucasjin
Upload triton_flash_blocksparse_attn.py
#21 opened almost 2 years ago
by
barcelosallan
"TypeError: phi3 isn't supported yet ". Could not quantize the phi3 model using the AWQ quantization method.
3
#20 opened almost 2 years ago
by
rabinghimire737
Multi-GPU case device mismatch while finetuning.
➕ 1
3
#19 opened almost 2 years ago
by
Satandon1999
CheckpointError in `triton_flash_blocksparse_attn.py` while finetuning
1
#18 opened almost 2 years ago
by
FremyCompany
Fix for FlashAttention RuntimeError & Triton Multi GPU fix.
1
#17 opened almost 2 years ago
by
Satandon1999
Out of resource: shared memory
6
#16 opened almost 2 years ago
by
iszhaoxin
RuntimeError: FlashAttention only support fp16 and bf16 data type
1
#15 opened almost 2 years ago
by
Satandon1999
Adding sample_finetune.py to small model
👍 1
1
#9 opened almost 2 years ago
by
hackint0sh
The attention mask and the pad token id were not set
#8 opened almost 2 years ago
by
hamidpalangi