-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Add dots3-note Preview model support #47844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4271569
ee04344
e4b8919
b5cbe05
bdefaaa
50d7cb0
fe87862
a7eafce
d8e147f
9daa866
e76affc
1f884b3
59e063f
45c24f2
f8a1f00
3732a1d
d8acaab
db923d7
42974dc
c6bdaed
cc8c2f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| <!--Copyright 2026 The Dots Studio team and the HuggingFace Inc. team. All rights reserved. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations under the License. | ||
|
|
||
| ⚠️ Note that this file is in Markdown but contains specific syntax for our doc-builder (similar to MDX) that may not be | ||
| rendered properly in your Markdown viewer. | ||
|
|
||
| --> | ||
| *This model was contributed to Hugging Face Transformers on 2026-09-09.* | ||
|
|
||
| # Dots 3 Note Preview | ||
|
|
||
| Dots 3 Note Preview is a mixture-of-experts causal language model with native text, image, video, and audio inputs. It uses | ||
| a shared vision encoder for images and videos and a Whisper-style audio encoder. Both encoders project their outputs | ||
| into the language model's hidden space before autoregressive text generation. | ||
|
|
||
| Dots 3 Note Preview checkpoints are available with BF16 weights or with fine-grained FP8 language-model weights and BF16 | ||
| vision, audio, and language-model-head weights. Both formats load through the standard Transformers APIs. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```python | ||
| from transformers import AutoModelForMultimodalLM, AutoProcessor | ||
|
|
||
|
|
||
| model_id = "dots-studio/dots3-note-prev" | ||
| processor = AutoProcessor.from_pretrained(model_id) | ||
| model = AutoModelForMultimodalLM.from_pretrained(model_id, device_map="auto") | ||
|
|
||
| conversation = [ | ||
| { | ||
| "role": "user", | ||
| "content": [ | ||
| {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png"}, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also might be nice to show each modality wdyt? |
||
| {"type": "text", "text": "Describe this image."}, | ||
| ], | ||
| } | ||
| ] | ||
| inputs = processor.apply_chat_template( | ||
| conversation, | ||
| add_generation_prompt=True, | ||
| tokenize=True, | ||
| return_dict=True, | ||
| return_tensors="pt", | ||
| ).to(model.device) | ||
|
|
||
| output_ids = model.generate(**inputs, max_new_tokens=128) | ||
| print(processor.batch_decode(output_ids, skip_special_tokens=True)[0]) | ||
| ``` | ||
|
|
||
| Use the same processing and generation calls with any of these user messages: | ||
|
|
||
| ```python | ||
| # Text | ||
| conversation = [{"role": "user", "content": [{"type": "text", "text": "Briefly introduce yourself."}]}] | ||
|
|
||
| # Audio: replace the path with a local recording. | ||
| conversation = [{"role": "user", "content": [ | ||
| {"type": "audio", "path": "speech.wav"}, | ||
| {"type": "text", "text": "Transcribe this recording."}, | ||
| ]}] | ||
|
|
||
| # Native video, including its audio track when present. | ||
| conversation = [{"role": "user", "content": [ | ||
| {"type": "video", "path": "concert.mp4"}, | ||
| {"type": "text", "text": "Describe what you see and hear."}, | ||
| ]}] | ||
| ``` | ||
|
|
||
| `Dots3NoteModel` combines the text, vision and audio encoders. `Dots3NoteForConditionalGeneration` adds the | ||
| language-model head and generation interface. `Dots3NoteTextForCausalLM` provides the text-only variant; | ||
| `Dots3NoteForCausalLM` remains a compatibility name for the original multimodal checkpoints. | ||
|
Comment on lines
+78
to
+79
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo its fine to have the for causal lm only variation, we dont really use textforcausallm |
||
|
|
||
| ## Dots3NoteConfig | ||
|
|
||
| [[autodoc]] Dots3NoteConfig | ||
|
|
||
| ## Dots3NoteVisionConfig | ||
|
|
||
| [[autodoc]] Dots3NoteVisionConfig | ||
|
|
||
| ## Dots3NoteAudioConfig | ||
|
|
||
| [[autodoc]] Dots3NoteAudioConfig | ||
|
|
||
| ## Dots3NoteForCausalLM | ||
|
|
||
| [[autodoc]] Dots3NoteForCausalLM | ||
| - forward | ||
|
|
||
| ## Dots3NoteModel | ||
|
|
||
| [[autodoc]] Dots3NoteModel | ||
| - forward | ||
|
|
||
| ## Dots3NoteForConditionalGeneration | ||
|
|
||
| [[autodoc]] Dots3NoteForConditionalGeneration | ||
|
|
||
| ## Dots3NoteTextModel | ||
|
|
||
| [[autodoc]] Dots3NoteTextModel | ||
| - forward | ||
|
|
||
| ## Dots3NoteTextForCausalLM | ||
|
|
||
| [[autodoc]] Dots3NoteTextForCausalLM | ||
| - forward | ||
|
|
||
| ## Dots3NoteVisionModel | ||
|
|
||
| [[autodoc]] Dots3NoteVisionModel | ||
| - forward | ||
|
|
||
| ## Dots3NoteAudioModel | ||
|
|
||
| [[autodoc]] Dots3NoteAudioModel | ||
| - forward | ||
|
|
||
| ## Dots3NoteProcessor | ||
|
|
||
| [[autodoc]] Dots3NoteProcessor | ||
| - __call__ | ||
|
|
||
| ## Dots3NoteImageProcessor | ||
|
|
||
| [[autodoc]] Dots3NoteImageProcessor | ||
|
|
||
| ## Dots3NoteVideoProcessor | ||
|
|
||
| [[autodoc]] Dots3NoteVideoProcessor | ||
|
|
||
| ## Dots3NoteFeatureExtractor | ||
|
|
||
| [[autodoc]] Dots3NoteFeatureExtractor | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @IlyasMoutawwakil when you have time to check this over can you share the motivation here? Ig there is some (new) fp4 handling we need?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still need an answer here, seems like something happens alongside the sharding so we don't have enough to properly unpack? we also want to move to a more uniform api in #48058 so would help which fp4 format we have here |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,9 @@ | |
| ("doge", "DogeConfig"), | ||
| ("donut-swin", "DonutSwinConfig"), | ||
| ("dots1", "Dots1Config"), | ||
| ("dots3_note", "Dots3NoteConfig"), | ||
| ("dots3_note_audio_encoder", "Dots3NoteAudioConfig"), | ||
| ("dots3_note_vision_encoder", "Dots3NoteVisionConfig"), | ||
| ("dpr", "DPRConfig"), | ||
| ("dpt", "DPTConfig"), | ||
| ("edgetam", "EdgeTamConfig"), | ||
|
|
@@ -790,6 +793,8 @@ | |
| ("dia_encoder", "dia"), | ||
| ("diffusion_gemma_text", "diffusion_gemma"), | ||
| ("donut-swin", "donut"), | ||
| ("dots3_note_audio_encoder", "dots3_note"), | ||
| ("dots3_note_vision_encoder", "dots3_note"), | ||
| ("edgetam_vision_model", "edgetam"), | ||
| ("emu3_text_model", "emu3"), | ||
| ("emu3_vqgan", "emu3"), | ||
|
|
@@ -1033,6 +1038,7 @@ | |
| ("cohere_asr", "CohereAsrFeatureExtractor"), | ||
| ("dac", "DacFeatureExtractor"), | ||
| ("dia", "DiaFeatureExtractor"), | ||
| ("dots3_note", "Dots3NoteFeatureExtractor"), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g. here it is correct |
||
| ("encodec", "EncodecFeatureExtractor"), | ||
| ("gemma3n", "Gemma3nAudioFeatureExtractor"), | ||
| ("gemma4", "Gemma4AudioFeatureExtractor"), | ||
|
|
@@ -1089,6 +1095,7 @@ | |
| ("deepseek_vl", "DeepseekVLProcessor"), | ||
| ("deepseek_vl_hybrid", "DeepseekVLHybridProcessor"), | ||
| ("dia", "DiaProcessor"), | ||
| ("dots3_note", "Dots3NoteProcessor"), | ||
| ("emu3", "Emu3Processor"), | ||
| ("ernie4_5_vl_moe", "Ernie4_5_VLMoeProcessor"), | ||
| ("evolla", "EvollaProcessor"), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,7 @@ | |
| ("dinat", {"torchvision": "ViTImageProcessor", "pil": "ViTImageProcessorPil"}), | ||
| ("dinov2", {"torchvision": "BitImageProcessor", "pil": "BitImageProcessorPil"}), | ||
| ("donut-swin", {"torchvision": "DonutImageProcessor", "pil": "DonutImageProcessorPil"}), | ||
| ("dots3_note", {"pil": "Dots3NoteImageProcessor"}), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here should be detected in auto mappings |
||
| ("edgetam", {"torchvision": "Sam2ImageProcessor"}), | ||
| ("emu3", {"pil": "Emu3ImageProcessor"}), | ||
| ("eomt_dinov3", {"torchvision": "EomtImageProcessor", "pil": "EomtImageProcessorPil"}), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing usage header?