Skip to content

Fix duplicated words in runtime error messages - #14331

Open
ErenAta16 wants to merge 1 commit into
huggingface:mainfrom
ErenAta16:fix-duplicated-words-in-messages
Open

Fix duplicated words in runtime error messages#14331
ErenAta16 wants to merge 1 commit into
huggingface:mainfrom
ErenAta16:fix-duplicated-words-in-messages

Conversation

@ErenAta16

Copy link
Copy Markdown

What does this PR do?

Nine user-facing messages under src/ repeat a word:

`latents` must have have batch size 1 or 2, but got 3
Do not know how to obtain obtain memory info for <module 'torch.cuda'>.

Eight are the same must have have batch size line in the input-expansion helpers across the modular pipelines — anima, flux, helios, qwenimage (×2), stable_diffusion_3, wan, z_image — and the ninth is in components_manager's offload path.

Triggered directly rather than read off the source:

before: `latents` must have have batch size 1 or 2, but got 3
after : `latents` must have batch size 1 or 2, but got 3

Found with a \b(\w+) \1\b sweep over src/diffusers, skipping fenced code and markup. Three other hits are deliberate and left alone:

  • "dai dai daie - daie - daie" — a prompt inside a pix2pix-zero docstring
  • "Guan Guan Ju Jiu" — a line of Chinese poetry in longcat_image/system_messages.py
  • "pip install imageio imageio-ffmpeg" — two different package names in import_utils.py

Dropping the duplicate shortens those lines enough that ruff wants the f-string on one line, so the raise collapses in seven files. ruff format --check reports all nine files as already formatted before this change, so I ran ruff format on them rather than leave CI red — that's why some hunks are 4 +--- instead of 2 +-.

#14294 fixes three of the same kind under docs/; no file overlap with this.

Before submitting

No test: these are message strings with no branch behaviour attached, and I'm not going to pin exact wording in a test that a maintainer would then have to update on every rephrase. ruff check and ruff format --check clean on all nine.

Who can review?

@yiyixuxu @sayakpaul @DN6

Nine user-facing messages in src/ repeat a word:

    `latents` must have have batch size 1 or 2, but got 3
    Do not know how to obtain obtain memory info for <module 'torch.cuda'>.

Eight of them are the same `must have have batch size` line in
repeat_tensor_to_batch_size / the input-expansion helpers across the
modular pipelines (anima, flux, helios, qwenimage x2, stable_diffusion_3,
wan, z_image); the ninth is in components_manager's offload path.

Dropping the duplicate shortens those lines enough that ruff wants the
f-string on one line, so the raise collapses in seven of the files. Ran
`ruff format` on the changed files -- the tree is already formatted before
this change, so leaving them unformatted would have failed CI.

Found with an AST/regex sweep for `\b(\w+) \1\b` over src/diffusers,
skipping code blocks and markup. Three other hits are deliberate and left
alone: "dai dai daie" in a pix2pix-zero docstring prompt, "Guan Guan Ju
Jiu" in longcat_image's system messages, and "pip install imageio
imageio-ffmpeg" in import_utils.

huggingface#14294 fixes three of the same kind in docs/; no overlap with these files.
@github-actions github-actions Bot added modular-pipelines size/S PR with diff < 50 LOC labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @ErenAta16, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modular-pipelines size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant