Skip to content

Processing tests [part 2] - #47922

Merged
zucchini-nlp merged 47 commits into
huggingface:mainfrom
zucchini-nlp:processing-more-test
Sep 4, 2026
Merged

zucchini-nlp merged 47 commits into
huggingface:mainfrom
zucchini-nlp:processing-more-test

Conversation

@zucchini-nlp

@zucchini-nlp zucchini-nlp commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

CPU CI GPU run-slow

What does this PR do?

  • Added a new testcase for return_replacement_offsets which will be used by vllm and finally become the only preferred way over mm_token_type_ids as it enables processing cache for simple models
  • Deleted a bunch of overriden test_chat_template for videos by allowing each child to define only input sampling args and expected number of samples frames
  • Unified some of duplicate tests by parameterizing per modality, still much to do but the PR is growing too big. I might open a [part 3] later on

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

Comment on lines -29 to 30
def __call__(self, text=None, images=None, visual_prompt=None, return_tensors=None, **kwargs):
def __call__(self, text=None, images=None, visual_prompt=None, **kwargs):
r"""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why separate, should be consumed via kwargs and merged in _merge_kwargs

@zucchini-nlp

Copy link
Copy Markdown
Member Author

Also should be ready now for a second review

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall happy with the state of the PR, just a few smaller comments but it's nothing major imo

Comment thread tests/test_processing_common.py Resolved
special_token_to_add = ""
if modalities is not None:
for modality in modalities:
# we have non-uniform naming conventions for image/videos

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up PR at some point? Just thinking for myself tbh

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i really dont want to, we will be dragging a huge deprecation cycle for a really long time. maybe for v6 after another 4 years 😆

return [prepare_image_inputs()] * batch_size
return prepare_image_inputs() * batch_size
return [prepare_images_inputs()] * batch_size
return prepare_images_inputs() * batch_size

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok maybe some ocd kicking in me but we use modality="image" and name ourselves with plural "prepare_images"

@zucchini-nlp zucchini-nlp Sep 2, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every place uses plural so in this PR i am trying to converge to it. In token IDs it is firstly BC, secondly weird/inconsistent with config classes

Most breaking point is public call API for all types of processors which always has been plural 😢 And everythgin after that copied plural form which is tbh not bad per se

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea it's not really, just gotta be consistent with the naming at some point :D

Comment thread tests/test_processing_common.py Resolved
Comment thread tests/test_processing_common.py Resolved
Comment thread tests/test_processing_common.py Outdated
return_dict=True,
return_tensors=return_tensors,
processor_kwargs={"num_frames": 2}, # by default no more than 2 frames, otherwise too slow
processor_kwargs={"num_frames": 2, "fps": None}, # no more than 2 frames, otherwise too slow

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add a comment tho?

Comment thread tests/test_processing_common.py Resolved
Comment thread tests/models/csm/test_processing_csm.py Resolved
@zucchini-nlp

Copy link
Copy Markdown
Member Author

I will merge it tmrw if fine and ask audio team to add audio tests. We'll probably need a [part 3] for the rest of cleaning, imo this unbloated a lot already

@vasqu

vasqu commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Sounds good, yes no worries. This PR is already big enough as is, let's unbloat step by step

My fear is the audio inconcistency but we will figure it out

@zucchini-nlp

zucchini-nlp commented Sep 4, 2026 •

Copy link
Copy Markdown
Member Author

Why 😢
could you force merge please, CI is not happy today and I dont' think it is related to this PR

Update: the new error after rebase is valid, checking

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

run-slow: aria, audioflamingo3, aya_vision, bridgetower, chameleon, clipseg, cohere_compass, colmodernvbert, colpali, colqwen2, cosmos3_edge, csm, deepseek_ocr2, emu3, ernie4_5_vl_moe, evolla

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 33865262432:1
Result: failure | Jobs: 15 | Tests: 66,461 | Failures: 1 | Duration: 5h 24m

@zucchini-nlp
zucchini-nlp added this pull request to the merge queue Sep 4, 2026
Merged via the queue into huggingface:main with commit 976e7a4 Sep 4, 2026
213 of 215 checks passed
@zucchini-nlp
zucchini-nlp deleted the processing-more-test branch September 4, 2026 11:31
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Sep 16, 2026
* .

* draft it

* fix some

* maybe

* .

* chat template in qwen style

* draft sth for video sampling tests

* fix

* .

* fix last

* move around

* draft

* .

* renamed those

* fix repo deleted one line in all files

* fix

* the rest

* merge this

* typo

* when will this end?

* fix?

* save coz now i will break stuff

* rename it all, except for xx_token_id

* missed these renames

* fix last

* revert

* comments

* less small private helpers

* more comments

* last failing tests, and i stop adding more stuff

* typo

* forgot about this one

* why i cannot get green CI

* move around to skip more tests

* few more

* fix

* new model

* here it is, opened PR on the hub

* forgot modular...
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.

3 participants