Skip to content

Conversation

@mkaic
Copy link
Contributor

@mkaic mkaic commented Mar 2, 2023

This is a small QOL PR that implements an optional parameter.

Currently, there is no way to have the CLIP text model return the entirety of its (batch x seq_length x embed_dim)-shaped output tensor, something that's quite useful if you want to use your model as part of, say, a Stable Diffusion training run.

I've added an optional parameter, return_all_embeddings, that can be included in the text_cfg section of a model config. It defaults to False, so this pull request won't change any default behavior. If it's set to True, the model will return the output vectors for all tokens in its input, not just the one for the EOS token.

@mkaic mkaic marked this pull request as draft March 3, 2023 03:18
@mkaic mkaic marked this pull request as ready for review March 10, 2023 21:11
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.

1 participant