Skip to content

Fix many type hint errors - #12289

Merged
yiyixuxu merged 15 commits into
huggingface:mainfrom
xlite-dev:fix-many-type-hint-errors
Sep 17, 2025
Merged

Fix many type hint errors#12289
yiyixuxu merged 15 commits into
huggingface:mainfrom
xlite-dev:fix-many-type-hint-errors

Conversation

@DefTruth

@DefTruthDefTruth commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

I'm the maintainer of cache-dit. cache-dit relies on type annotations to match the forward pattern of blocks more precisely. However, I found that there are a large number of type annotation errors in diffusers. For instance, HiDream, HunyuanVideo, cogvideox, auraflow, cogview, lumina, etc. This PR has fixed all related errors.

PTAL ~ @a-r-r-o-w@sayakpaul

for example, fix hidream type hint:

torch.Tensor->Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]

@DefTruthDefTruth mentioned this pull request Sep 5, 2025
@DefTruth

Copy link
Copy Markdown
ContributorAuthor

@sayakpaul

@sayakpaulsayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks so much! Left some comments.

Comment threadsrc/diffusers/models/transformers/auraflow_transformer_2d.py
Comment threadsrc/diffusers/models/transformers/consisid_transformer_3d.py
Comment threadsrc/diffusers/models/transformers/transformer_bria.py
@DefTruth

Copy link
Copy Markdown
ContributorAuthor

@sayakpaul PTAL~

@sayakpaulsayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@sayakpaul
sayakpaul requested a review from DN6September 15, 2025 05:58
@sayakpaul

Copy link
Copy Markdown
Member

@bot /style

@github-actions

Copy link
Copy Markdown
Contributor

Style fix is beginning .... View the workflow run here.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@yiyixuxu

Copy link
Copy Markdown
Collaborator

@bot /style

@github-actions

Copy link
Copy Markdown
Contributor

Style fix is beginning .... View the workflow run here.

@yiyixuxu

Copy link
Copy Markdown
Collaborator

can you run make style? somehow style bot cannot fix the formats here

@DefTruth

Copy link
Copy Markdown
ContributorAuthor

can you run make style? somehow style bot cannot fix the formats here

@yiyixuxu done, PTAL~

@yiyixuxu
yiyixuxu merged commit efb7a29 into huggingface:mainSep 17, 2025
9 of 10 checks passed
@DefTruth
DefTruth deleted the fix-many-type-hint-errors branch September 18, 2025 03:49
Sign up for freeto 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.

4 participants

@DefTruth@sayakpaul@HuggingFaceDocBuilderDev@yiyixuxu