[docs] adding audio/video processors - #45795
Conversation
|
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. |
zucchini-nlp
left a comment
There was a problem hiding this comment.
Nice to see more docs about each modality! The main q I have is about sectioning, since for me video+image belong together more than with audio. The API is also very similar to both
Also left a few more comments on common pain points when reviewing a model
| # Add audio or video processors | ||
|
|
||
| Audio models require a feature extractor and video models require a video processor. Multimodal models use a processor that wraps some combination of a tokenizer, feature extractor, image processor, or video processor behind one [`AutoProcessor`] entry point. | ||
|
|
There was a problem hiding this comment.
not sure this is the right sectioning. Video is also part of vision processing component imo. Prob we need a 1) small dropdown sectioning for multimodal processing and add three separately (images/videos/audio) OR 2) we can have "vision" and "audio" as two big sections
There was a problem hiding this comment.
lets have image/video as one section, audio as another, and use your docs in #45493 for multimodal processors :)
|
|
||
| > [!TIP] | ||
| > See [`Gemma4Processor`] and [`Qwen3OmniMoeProcessor`] for reference. | ||
|
|
There was a problem hiding this comment.
for processors, there is one more thing to mention. The usage of typed dicts and that we can enforce model-specific defaults in there
(now that I think of it, I dont understand why we set defaults in code and not save in configs 🤔 cc @molbap if you remember, or is that for BC?)
They are later merged in
transformers/src/transformers/processing_utils.py
Lines 1205 to 1248 in 7f6419e
| Map the new classes to the model config so the `Auto` classes can load them. The generated auto mapping file has a warning at the top. Do not edit it by hand. Add or update the model config, then run: | ||
|
|
||
| ```bash | ||
| python utils/check_auto.py --fix_and_overwrite |
There was a problem hiding this comment.
oh this doesn't yet work for Processor and FeatureExtractor. I wanted to be sure it doesn't create new issues, and then expand more 😅
Will work on it next week!
There was a problem hiding this comment.
sounds good! removed for now, but will add it back once its ready :)
|
Also linking #45493 (processing refactor), I will add docs explaining how to add processors with the new API in mind and how to convert from old format to new. Not sure which one gets merged first, so I will tag you for review when the doc is pushed |
zucchini-nlp
left a comment
There was a problem hiding this comment.
Thanks
I will merge the other PR on processors this week, and I can just rebase on top of yours. Feel free to merge when ready
| from ...feature_extraction_sequence_utils import SequenceFeatureExtractor | ||
|
|
||
|
|
||
| class MyModelFeatureExtractor(SequenceFeatureExtractor): |
There was a problem hiding this comment.
might need a re-do after merging #44394, just linking :)
* docs * feedback * tests * feedback
* docs * feedback * tests * feedback
* docs * feedback * tests * feedback
* docs * feedback * tests * feedback
* docs * feedback * tests * feedback
follow up to this comment about separate docs for how to add audio and video processors