Automatic Speech Recognition
Transformers
Safetensors
phi4mm
text-generation
nlp
code
audio
speech-summarization
speech-translation
visual-question-answering
phi-4-multimodal
phi
phi-4-mini
custom_code
Eval Results
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)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-multimodal-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Make Phi4MMForCausalLM.forward's num_logits_to_keep actually optional
#20
by phh - opened
Fixes:
File "/home/phh/.cache/huggingface/modules/transformers_modules/microsoft/Phi-4-multimodal-instruct/a11e830f953efbce02a57d3b672f84c5140e3f94/modeling_phi4mm.py", line 2137, in forward
logits = self.lm_head(hidden_states[:, -num_logits_to_keep:, :])
^^^^^^^^^^^^^^^^^^^
TypeError: bad operand type for unary -: 'NoneType'
Hey, I have the same issue when using transformers==4.49.0 is it also your case ?
If it is the case, I recommend you using transformers==4.48.2 and wait the transformers integration
+1
Downgrading transformers indeed fixed the issue.
nguyenbh changed pull request status to closed