Run this model with HF Jobs
Run microsoft/Phi-4-multimodal-instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/microsoft/Phi-4-multimodal-instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/microsoft/Phi-4-multimodal-instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use microsoft/Phi-4-multimodal-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Phi-4-multimodal-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="microsoft/Phi-4-multimodal-instruct", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-multimodal-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fine-tuning on a new language
Would love to give this a try and fine-tune on a new language. But it is not very clear as to how to extend the vocab and tokenizer for the new language. Also, when trying to do basic eval we keep getting this error:
bad operand type for unary -: 'NoneType'
Found this issue: https://huggingface.co/microsoft/Phi-4-multimodal-instruct/discussions/46 which perhaps is the same issue?
It would be great if you can provide some guidance on:
- Extending vocab
- Customizing tokenizer
- And the
NoneTypeerror
Looked at the Korean fine-tuning example and also saw Notebooks of folks attempting to fine-tune for languages like Turkish. But there seems to be no common way to easily fine-tune on downstream task(s) / new language(s).
@amaraa
If you have inference errors, please double check the environ and dependencies, this is what we suggest
https://huggingface.co/microsoft/Phi-4-multimodal-instruct#requirements
Alternatively you can look at this dockerfile
https://github.com/anastasiosyal/phi4-multimodal-instruct-server/blob/main/dockerfile
This is the writeup for Korean finetuning contributed by the community.
https://huggingface.co/microsoft/Phi-4-multimodal-instruct#appendix-b-fine-tuning-korean-speech