Image-Text-to-Text
Transformers
Safetensors
multilingual
phi3_v
text-generation
nlp
code
vision
conversational
custom_code
Instructions to use microsoft/Phi-3.5-vision-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Phi-3.5-vision-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="microsoft/Phi-3.5-vision-instruct", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3.5-vision-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use microsoft/Phi-3.5-vision-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-vision-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-vision-instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/microsoft/Phi-3.5-vision-instruct
- SGLang
How to use microsoft/Phi-3.5-vision-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-vision-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-vision-instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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-vision-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-vision-instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use microsoft/Phi-3.5-vision-instruct with Docker Model Runner:
docker model run hf.co/microsoft/Phi-3.5-vision-instruct
Request: DOI
#44 opened 14 days ago
by
JackIsTheBoss
Token Count Calculation in SFT Data Distribution Curation
#41 opened 6 months ago
by
tcy006
Update generation_config.json
#40 opened 10 months ago
by
dtrawins
Make model compatible with Transformers v4.49.0
4
#39 opened about 1 year ago
by
hmellor
Update modeling_phi3_v.py for compatibility with transformers 4.49
👍 8
4
#37 opened about 1 year ago
by
sylwia-kuros
Update modeling_phi3_v.py
#36 opened over 1 year ago
by
t-shaurysrivastav
Extend eos_token_id
#35 opened over 1 year ago
by
Wovchena
RuntimeError: shape mismatch: value tensor of shape [4706, 3072] cannot be broadcast to indexing result of shape [9412, 3072]
👍 1
#34 opened over 1 year ago
by
INDABAX
RuntimeError: FlashAttention only support fp16 and bf16 data type with Flash attention2
1
#33 opened over 1 year ago
by
liougehooa
Support for base image
#32 opened over 1 year ago
by
nicokossmann
How do I use this model along with HuggingfaceInference ?
#31 opened over 1 year ago
by
perceptron-743
Update processing_phi3_v.py
#30 opened over 1 year ago
by
rageSpin
Adjust generation verbosity
#29 opened over 1 year ago
by
nzarif
Can this model give a pixel bound box of the OCR/object detection?
1
#27 opened over 1 year ago
by
pacozaa
Fine tuning Phi-3 for OCR
2
#26 opened over 1 year ago
by
ShanenThomas
Batch inference
👍 1
1
#25 opened over 1 year ago
by
gordonyeh
Finetuning script for Phi3.5-Vision
❤️ 3
4
#24 opened over 1 year ago
by
2U1
BOS token in front of every text chunk
#22 opened over 1 year ago
by
websterbei
Compatibility and Support for NVIDIA RTX™ 6000 Ada Generation GPU
1
#20 opened over 1 year ago
by
surajpatil4899
Stop Bumping your Models on Huggingface, its getting annoying
👍 2
#19 opened over 1 year ago
by
KingBadger
Adding audio support
#17 opened over 1 year ago
by
Barshan
What is configuration of demo space?
#15 opened over 1 year ago
by
DLipatnikov
Open-Source communities needs Microsoft support
🔥 1
1
#11 opened over 1 year ago
by
haohoo
🍭 Fine-Tuning of Phi3.5-vision-instruct
🔥 1
#9 opened over 1 year ago
by
study-hjt
Ollama availability
2
#8 opened over 1 year ago
by
ramesh3012