Text Generation
Transformers
Safetensors
multilingual
phi3
nlp
code
conversational
custom_code
Eval Results
text-generation-inference
Instructions to use microsoft/Phi-3.5-mini-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Phi-3.5-mini-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/Phi-3.5-mini-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3.5-mini-instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3.5-mini-instruct", trust_remote_code=True) 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
- vLLM
How to use microsoft/Phi-3.5-mini-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.5-mini-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.5-mini-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/microsoft/Phi-3.5-mini-instruct
- SGLang
How to use microsoft/Phi-3.5-mini-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.5-mini-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.5-mini-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.5-mini-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.5-mini-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use microsoft/Phi-3.5-mini-instruct with Docker Model Runner:
docker model run hf.co/microsoft/Phi-3.5-mini-instruct
Request: DOI
#45 opened about 2 months ago
by
ibot1212
Add gsm8k eval result
π 5
#44 opened 4 months ago
by
julien-c
Updated modelling.py - replaced deprecated get_max_length() with get_max_cache_shape() for transformers 4.49+
#41 opened 11 months ago
by
Laksh-Jain
Feedback on Hungarian Language Support
#40 opened about 1 year ago
by
megvadulthangya
fix bug 'DynamicCache' object has no attribute 'get_max_length' , updata modeling_phi3.py
3
#39 opened about 1 year ago
by
Qodi
no need for custom_code anymore
#38 opened about 1 year ago
by
julien-c
Update modeling_phi3.py for compatibility with transformers 4.49
3
#35 opened about 1 year ago
by
sylwia-kuros
Fine tuning phi-3.5 or phi-2 ?
#33 opened about 1 year ago
by
lpalbou
Request: DOI
#32 opened over 1 year ago
by
VibhaB
I have 3 apples. Last week I ate 2 apples. How many apples do I have?
1
#31 opened over 1 year ago
by
JLouisBiz
Model not responding
#30 opened over 1 year ago
by
Dm124r
Phi-3.5-mini-instruct: CPU vs. GPU Mismatch Error in modeling_phi3.py During Generation
5
#29 opened over 1 year ago
by
Stiander
Determinism Challenges with Microsoft Phi-3.5-mini-instruct Across Different GPU Architectures
1
#28 opened over 1 year ago
by
HumzaAli
microsoft/Phi-3.5-mini-instruct not working with FA2 due to position_ids
#27 opened over 1 year ago
by
BramVanroy
Looking forward to the phi 4 model release.
3
#26 opened over 1 year ago
by
win10
Hallucinated reply if you prompt same prompt several times. Ollama and phi3.5
1
#25 opened over 1 year ago
by
sepihala
curl run on colab
1
#23 opened over 1 year ago
by
sdyy
KeyError: 'phi3' when attempting to train in Oogabooga
1
#21 opened over 1 year ago
by
Bob4444
Please support phi-3.5-mini-instruct in llama.cpp
ππ 2
2
#20 opened over 1 year ago
by
ThiloteE
Can't install flash_attn package on WSL2
π 1
#19 opened over 1 year ago
by
aytugkaya
How to add new token or special token?
#16 opened over 1 year ago
by
hahaMiao
Evaluation of Phi-3.5 on long-context BABILong bench
π 1
1
#12 opened over 1 year ago
by
yurakuratov
Phi3ForCausalLM.forward() got an unexpected keyword argument 'decoder_input_ids'
#11 opened over 1 year ago
by
Tejarao
tokenizer.model_max_length=2048 in sample_finetune.py
#10 opened over 1 year ago
by
anakin87
Very safe model!
π 1
9
#6 opened over 1 year ago
by
SicariusSicariiStuff
Will there be int 4 ONNX DirectML versions in the future?
π 5
2
#5 opened over 1 year ago
by
PaulTheHuman
My quants and my "silly" version.
#4 opened over 1 year ago
by
ZeroWw
Why not include MedQA in your benchmarks?
3
#1 opened over 1 year ago
by
Hugman2345