Skip to content

Fix failing XCLIPModelIntegrationTest#45053

Open
Sai-Suraj-27 wants to merge 1 commit intohuggingface:mainfrom
Sai-Suraj-27:fix_xclip
Open

Fix failing XCLIPModelIntegrationTest#45053
Sai-Suraj-27 wants to merge 1 commit intohuggingface:mainfrom
Sai-Suraj-27:fix_xclip

Conversation

@Sai-Suraj-27
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes failing XCLIPModelIntegrationTests.

self.get_attributes() will not return all the processor instance attributes, for example in case of x_clip because video_processor is added like this.

processor = XCLIPProcessor.from_pretrained(
    "microsoft/xclip-base-patch32", size=180, crop_size={"height": 180, "width": 180}
)
processor.get_attributes()
# ['image_processor', 'tokenizer']

Iterating directly over the attribute_to_kwargs in __call__ will check for all types at run-time.

Code Agent Policy

The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.

PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.

This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read CONTRIBUTING.md.

  • I confirm that this is not a pure code agent PR.

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 write any new necessary tests?

Who can review?

@Rocketknight1 @vasqu @zucchini-nlp

@Rocketknight1
Copy link
Copy Markdown
Member

Hmm, this feels like a very core change for one model. cc @zucchini-nlp maybe?

@Sai-Suraj-27
Copy link
Copy Markdown
Contributor Author

Sai-Suraj-27 commented Mar 27, 2026

Hmm, this feels like a very core change for one model. cc @zucchini-nlp maybe?

Okayy, even now when looping through self.get_attributes() we are again making sure that it exists in attribute_to_kwargs, so directly looping through attribute_to_kwargs will not cause any new issues, hopefully.

Also, found tvp processor to be similar.

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.

2 participants