Skip to content

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Sep 20, 2025

What does this PR do?

Move methods like calculate_shift(), retrieve_latents(), and retrieve_timesteps() to pipeline_utils.py to reduce a lot of LOC.

Didn't make these changes to the files under examples/community.

Note

I didn't start any deprecation for this because the respective scripts from which these methods are removed will anyway contain their imports.

@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.

@JoeGaffney
Copy link

JoeGaffney commented Sep 22, 2025

Nice, i do know there is a do repeat yourself ethos and I'm not a massive fan of overly DRY code with confusing abstractions.

But think in allot of cases lifting more of the common things out instead of the # Copied from makes allot more sense in readability. Especially as more and pipelines are sharing ideas from one another.

@sayakpaul
Copy link
Member Author

Thanks @JoeGaffney! Yes, those will essentially be considered similar to how transformers does it (something like unpacking inheritance to not distort readability).

@DN6
Copy link
Collaborator

DN6 commented Sep 22, 2025

Looks good to me. cc: @yiyixuxu here too.

@sayakpaul sayakpaul requested a review from yiyixuxu September 22, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants