Skip to content

Conversation

@tanuj-rai
Copy link
Contributor

@tanuj-rai tanuj-rai commented Jun 15, 2025

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.

#36979

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@stevhliu

Copy link
Member

@stevhliu stevhliu left a 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 id="AutoModel">

```python
from transformers import AutoProcessor, AutoModelForCausalLM
Copy link
Member

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
Copy link
Member

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'

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

We'll merge for now and fix the code examples later :)

@stevhliu stevhliu merged commit 8d40ca5 into huggingface:main Jul 14, 2025
15 checks passed
@tanuj-rai
Copy link
Contributor Author

Thanks!

We'll merge for now and fix the code examples later :)

Great @stevhliu!. Thank you so much for every change you have suggested.

rjgleaton pushed a commit to rjgleaton/transformers that referenced this pull request Jul 17, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* Update phi4_multimodal.md

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/phi4_multimodal.md

Co-authored-by: Steven Liu <[email protected]>

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

* Update phi4_multimodal.md

---------

Co-authored-by: Steven Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants