Skip to content

fix(models): Apply STE in Dac.from_latents to match the forward pass#43820

Open
harshaljanjani wants to merge 1 commit intohuggingface:mainfrom
harshaljanjani:fix/dac-from-latents-ste
Open

fix(models): Apply STE in Dac.from_latents to match the forward pass#43820
harshaljanjani wants to merge 1 commit intohuggingface:mainfrom
harshaljanjani:fix/dac-from-latents-ste

Conversation

@harshaljanjani
Copy link
Contributor

What does this PR do?

The following issue was identified and fixed in this PR:

→ Implemented a fix that applies the straight-through estimator to each latent chunk before out_proj, following the straight-through estimator pattern used in the forward pass (DacResidualVectorQuantizer.from_latents was missing STE before calling out_proj). Also fixes some CI regressions, still not sure which commit caused them, but CI is a tad bit happier again :)
→ Added the repro script to the linked issue.

Fixes #43819.

Before the fix (feel free to cross-check; these errors are reproducible):

before_dac_2

After the fix (feel free to cross-check):

after_dac_2 after_dac

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 fix any necessary existing tests?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

[For maintainers] Suggested jobs to run (before merge)

run-slow: dac

@harshaljanjani harshaljanjani marked this pull request as ready for review February 7, 2026 14:51
@github-actions github-actions bot requested a review from eustlb February 7, 2026 14:51
@harshaljanjani harshaljanjani changed the title fix(models): Apply STE in DacResidualVectorQuantizer.from_latents to match the forward pass fix(models): Apply STE in Dac.from_latents to match the forward pass Feb 7, 2026
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.

[BUG] DAC.from_latents does not match the forward pass with missing STE

2 participants