Skip to content

fix(guiders): fix undefined attribute in TangentialClassifierFreeGuid… - #14796

Open
dafahaha wants to merge 1 commit into
huggingface:mainfrom
dafahaha:fix-tangential-guidance-typo
Open

dafahaha wants to merge 1 commit into
huggingface:mainfrom
dafahaha:fix-tangential-guidance-typo

Conversation

@dafahaha

Copy link
Copy Markdown

…ance.is_conditional

TangentialClassifierFreeGuidance.is_conditional reads self._num_outputs_prepared, which is not defined anywhere in the class or base class. The correct attribute name is self._count_prepared, which is set in BaseGuidance.init and incremented in prepare_inputs. All other guiders use this correct attribute.

This bug causes AttributeError when accessing is_conditional (and by extension is_unconditional, which is defined as not self.is_conditional).

Fixes #14794

What does this PR do?

Fixes # (issue)

Before submitting

  • Did you use an AI agent (Claude Code, Codex, Cursor, etc.) to help with this PR? If so:
    • Did you read the Coding with AI agents guide?
    • Did you run the self-review skill on the diff?
    • Did you share the final self-review notes in the PR description or a comment?
  • Did you read the contributor guideline?
  • Did you read our philosophy doc? (important for complex PRs)
  • 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?
  • Are you the author (or part of the team) of the model/pipeline (only applicable for model/pipeline related PRs)?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

…ance.is_conditional

TangentialClassifierFreeGuidance.is_conditional reads self._num_outputs_prepared,
which is not defined anywhere in the class or base class. The correct attribute
name is self._count_prepared, which is set in BaseGuidance.__init__ and
incremented in prepare_inputs. All other guiders use this correct attribute.

This bug causes AttributeError when accessing is_conditional (and by extension
is_unconditional, which is defined as not self.is_conditional).

Fixes huggingface#14794
@github-actions github-actions Bot added guiders size/S PR with diff < 50 LOC fixes-issue labels Sep 17, 2026

This branch has not been deployed

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

Labels

fixes-issue guiders size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TangentialClassifierFreeGuidance.is_conditional reads an attribute that does not exist

1 participant