transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Fixes issue #38709 for CLIP and XCLIP

Open Vishu26 opened this issue 4 months ago • 2 comments

What does this PR do?

Fixes #38709 (at least for CLIP and XCLIP for now and is fully backward compatible and existing functionality remains unaffected).

Previously, get_<>_features function in CLIP and XCLIP always return the pooled_output. Now, if output_hidden_states is set, the function returns a dict. It is set to None by default, so the existing behavior will be unaffected.

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?
  • [x ] 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?

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.

Vishu26 avatar Jun 11 '25 16:06 Vishu26