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
fixes the asserion error when num_beams > 1
#42
by freewym - opened
- modeling_phi4mm.py +1 -1
modeling_phi4mm.py
CHANGED
|
@@ -2096,7 +2096,7 @@ class Phi4MMForCausalLM(Phi4MMPreTrainedModel, GenerationMixin):
|
|
| 2096 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 2097 |
|
| 2098 |
if isinstance(input_mode, torch.Tensor):
|
| 2099 |
-
|
| 2100 |
input_mode = input_mode[0].item()
|
| 2101 |
input_mode = InputMode(input_mode)
|
| 2102 |
|
|
|
|
| 2096 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 2097 |
|
| 2098 |
if isinstance(input_mode, torch.Tensor):
|
| 2099 |
+
# len(input_mode) == num_beams in beam search, and all elements of input_mode should have the same value
|
| 2100 |
input_mode = input_mode[0].item()
|
| 2101 |
input_mode = InputMode(input_mode)
|
| 2102 |
|