-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Update phi4_multimodal.md #38830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update phi4_multimodal.md #38830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
``` | ||
|
||
</hfoption> | ||
<hfoption id="transformers-cli"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove since the command line doesn't accept image or speech inputs
</hfoption> | ||
</hfoptions> | ||
|
||
## Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add:
- The example below demonstrates inference with an audio and text input.
```py
add the audio processing code example here
|
||
```python | ||
from transformers import AutoProcessor, AutoModelForCausalLM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Cyrilvallez, when I try to run the code in the Usage tips, I get the following error. Would you mind taking a look please? 😄
[/usr/local/lib/python3.11/dist-packages/jinja2/environment.py](https://localhost:8080/#) in handle_exception(self, source)
940 from .debug import rewrite_traceback_stack
941
--> 942 raise rewrite_traceback_stack(source=source)
943
944 def join_path(self, template: str, parent: str) -> str:
<template> in top-level template code()
TypeError: can only concatenate str (not "list") to str
|
||
`Phi4-multimodal-instruct` can be found on the [Huggingface Hub](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) | ||
```python | ||
from transformers import pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cyrilvallez, this code example also returns the following error:
AttributeError: 'LoraModel' object has no attribute 'prepare_inputs_for_generation'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
[/usr/local/lib/python3.11/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in __getattr__(self, name)
1926 if name in modules:
1927 return modules[name]
-> 1928 raise AttributeError(
1929 f"'{type(self).__name__}' object has no attribute '{name}'"
1930 )
AttributeError: 'Phi4MMModel' object has no attribute 'prepare_inputs_for_generation'
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
What does this PR do?
This PR updates the Phi-4 Multimodal card documentation as described in #36979, in an attempt to standardize all model-cards.
Fixes #36979
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@stevhliu