Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jiqing-feng
Copy link
Contributor

The dtype in the pipeline does not work if I don't pass device_map. To reproduce the error:

from transformers import pipeline
import torch

image_to_text = pipeline(
        "image-feature-extraction",
        model="google/vit-base-patch16-224-in21k",
        dtype=torch.bfloat16,
    )
print(image_to_text.model.dtype)

output before this PR

torch.float32

output after this PR

torch.bfloat16

Hi @SunMarc . Please review this PR. Thanks!

@jiqing-feng jiqing-feng marked this pull request as ready for review September 3, 2025 06:51
@jiqing-feng
Copy link
Contributor Author

Hi @SunMarc , the failed CI seems not related to my changes.

Copy link
Member

@SunMarc SunMarc 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 spotting this ! There is indeed an issue with the indentation

@SunMarc SunMarc requested a review from Cyrilvallez September 3, 2025 08:51
@SunMarc SunMarc added the for patch Tag issues / labels that should be included in the next patch label Sep 3, 2025
@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

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Oh woww! Indeed the indentation got lost!! Thanks a lot!

@Cyrilvallez Cyrilvallez merged commit f2416b4 into huggingface:main Sep 3, 2025
20 of 24 checks passed
Cyrilvallez pushed a commit that referenced this pull request Sep 4, 2025
Signed-off-by: jiqing-feng <[email protected]>
Co-authored-by: Marc Sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for patch Tag issues / labels that should be included in the next patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants