Skip to content

[pull] main from huggingface:main - #8

Merged
pull[bot] merged 4 commits into
ZikrieHR:mainfrom
huggingface:main
Sep 9, 2026
Merged

pull[bot] merged 4 commits into
ZikrieHR:mainfrom
huggingface:main

Conversation

@pull

@pull pull Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

swankystark and others added 4 commits September 9, 2026 06:56
* Fix YOLOS device mismatch with device_map="auto"

* Set _no_split_modules for YOLOS and revert .to() workaround

YOLOS was missing the proper _no_split_modules entries, which caused
infer_auto_device_map to split inside YolosLayer when using
device_map='auto'. This led to device mismatch errors on multi-GPU
setups because residual connections inside YolosLayer were split
across devices.

This change:
- Sets _no_split_modules = ["YolosEmbeddings", "YolosLayer"] to match
the pattern used by ViT, DeiT, DINOv2, BEiT, and other vision models.
- Reverts the .to(hidden_states.device) workaround, which was a
symptom-level fix rather than the structural fix.

Fixes #46869

---------

Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Pablo Montalvo <[email protected]>
* Add Fun-ASR-Nano model (800M end-to-end ASR)

Fun-ASR-Nano is a speech recognition model from Alibaba DAMO Academy
consisting of a SANM audio encoder, Transformer adaptor, and Qwen3-0.6B LLM.

This commit adds:
- configuration_fun_asr_nano.py: Config classes for all components
- modeling_fun_asr_nano.py: SANM encoder, adaptor, CTC decoder, main model
- feature_extraction_fun_asr_nano.py: Mel + LFR feature extractor
- convert_fun_asr_nano_to_hf.py: Weight conversion from FunASR format

Resolves #46179

* Add processor, tests, and documentation for Fun-ASR-Nano

* Register Fun-ASR-Nano in Auto classes

* Fix code quality: ruff format, remove auto-generated file edits

* Fix code quality: ruff format, correct Auto class registration

* Address review: add integration tests, replace build_chat_input with apply_chat_template

* Fix docstring check: use @auto_docstring on processor __call__

* Fix: document sampling_rate param for auto_docstring check

* Fix processor docstring to match Qwen2Audio pattern

* Add test file to TEST_FILES_WITH_NO_COMMON_TESTS

* Rewrite tests with ALMModelTester/ALMModelTest common test pattern

* Fix: simplify conditional_generation_class assignment for check_repo regex

* Add AdaptorConfig and CtcConfig to docs

* Retrigger CI + remove build_chat_input from docs

* Add **kwargs to FunAsrNanoEncoder.forward for check_repo compatibility

* Add @auto_docstring with checkpoint to config classes

* Fix all config classes: use @strict + class-level annotations + @auto_docstring

* Document all config parameters for auto_docstring check

* Remove unused positional_dropout_rate from encoder config

* Add dates to model doc

* tests: add integration tests for FunAsrNano (generate Chinese/English)

* Fix FunAsrNano tests and audio processor

* Refactor fun_asr_nano to modular pattern; address review

- Add modular_fun_asr_nano.py as the canonical source; modeling/config/processing
  now generate from it (modular conversion in sync, idempotent).
- Rename encode_audio -> get_audio_features (audioflamingo3 convention), returning
  BaseModelOutputWithPooling; add a proper FunAsrNanoPreTrainedModel base class.
- Fold the adaptor params into the main config (Voxtral pattern); keep the encoder
  config standalone (Parakeet pattern); drop the unused CTC config/head (no CTC
  weights in the checkpoint, not on the generation path).
- Processor: drop custom batch_decode/decode forwarders and the default chat
  template; the chat template now lives in the checkpoint (chat_template.jinja),
  written by the convert script (vibevoice_asr pattern).
- Docs: add single/batch/training/torch.compile usage sections.
- Tests: real single/batch integration tests against the checkpoint (output
  byte-identical to the pre-refactor baseline).

* Fix fun_asr_nano model card contribution date (repo-consistency check)

* Refactor fun_asr_nano to modular pattern and fix checkpoint dtype

- Migrate the model to the modular pattern: split lm_head out of the base
  FunAsrNanoModel (mirroring AudioFlamingo3 / Voxtral), and regenerate
  modeling from modular.
- Move the audio feature extraction to a torch-based FunAsrNanoFeatureExtractor
  and tidy the processor.
- Fix the conversion script to emit a dtype-consistent bf16 checkpoint
  (cast every weight to bfloat16, set config.dtype=bfloat16). This shrinks
  the checkpoint from 2.75GB to 1.97GB, matching the LLM dtype. lm_head.weight
  is kept explicitly (deduplicated by safetensors against the tied embeddings),
  giving 0 missing / 0 unexpected keys on load.
- Make the integration test model id overridable via env for local checkpoint
  verification.

* fix(fun_asr_nano): declare tie_word_embeddings in config and refresh model card date

- Declare tie_word_embeddings on FunAsrNanoConfig (the model defines
  _tied_weights_keys, so the config must expose tie_word_embeddings per the
  modeling-structure rule TRF015).
- Refresh the model card contribution date (add_dates check).

* Address Fun-ASR-Nano processor review comments

* Fix Fun-ASR-Nano modular mask handling

* Fix Fun-ASR-Nano model doc date

* Fix Fun-ASR-Nano copyright years

* Generate Fun-ASR-Nano config from modular

* Generate Fun-ASR-Nano processor from modular

* Format Fun-ASR-Nano modular processor

* Use standard Fun-ASR-Nano config names

* Reuse sinusoidal position embedding helper

* Reuse audio chat-template normalization

* Document Fun-ASR-Nano conversion flow

* Guard Fun-ASR-Nano feature extractor imports

* Clarify Fun-ASR-Nano checkpoint key mapping

* Use real audio in Fun-ASR-Nano training docs

* Trim Fun-ASR-Nano config docstrings

* Reuse Llama eager attention in Fun-ASR-Nano

* Trigger Fun-ASR-Nano CI rerun

* Fix FunASR Nano processor isinstance style

* Fix FunASR Nano GPU test coverage

* Refactor Fun-ASR-Nano with shared audio components

* Fix FunASR Nano Bandit check

* Fix FunASR Nano quality checks

* Fix Fun-ASR-Nano model contribution date

* Address remaining Fun-ASR-Nano review feedback

* Address Fun-ASR-Nano integration review

* Remove redundant Fun-ASR-Nano config docs

* Fix legacy Fun-ASR-Nano checkpoint config loading

* Fix Fun-ASR-Nano config attribute usage

* Update Fun-ASR-Nano model date

* Adjust Fun-ASR-Nano offload test split

* Refresh Fun-ASR-Nano model doc date

* Address Fun-ASR-Nano modular review feedback

* Reuse AudioFlamingo3 processor call

* Align Fun-ASR-Nano processor review fixes

* Use Fun-ASR-Nano attention directly in adaptor

* Address Fun-ASR-Nano encoder review comments

* Add Fun-ASR-Nano adaptor subconfig

* Update Fun-ASR-Nano adaptor auto mapping

* Align Fun-ASR-Nano generated processor

* Sync Fun-ASR-Nano generated attention

* Export Fun-ASR-Nano adaptor config

* Document Fun-ASR-Nano adaptor config

* Allow derived Fun-ASR-Nano input attributes

* Update Fun-ASR-Nano model card date

* Separate config since doesn't need modular, and cleanup legacy args. Separate multimodal projector.

* Nit naming.

* Nit naming.

* Switch to ternary.

* Fix Fun-ASR-Nano consistency checks

Signed-off-by: LauraGPT <[email protected]>

* refactor ternary

* Add Fun-ASR-Nano model (800M end-to-end ASR)

Fun-ASR-Nano is a speech recognition model from Alibaba DAMO Academy
consisting of a SANM audio encoder, Transformer adaptor, and Qwen3-0.6B LLM.

This commit adds:
- configuration_fun_asr_nano.py: Config classes for all components
- modeling_fun_asr_nano.py: SANM encoder, adaptor, CTC decoder, main model
- feature_extraction_fun_asr_nano.py: Mel + LFR feature extractor
- convert_fun_asr_nano_to_hf.py: Weight conversion from FunASR format

Resolves #46179

* Add processor, tests, and documentation for Fun-ASR-Nano

* Register Fun-ASR-Nano in Auto classes

* Fix code quality: ruff format, remove auto-generated file edits

* Fix code quality: ruff format, correct Auto class registration

* Address review: add integration tests, replace build_chat_input with apply_chat_template

* Fix docstring check: use @auto_docstring on processor __call__

* Fix: document sampling_rate param for auto_docstring check

* Fix processor docstring to match Qwen2Audio pattern

* Add test file to TEST_FILES_WITH_NO_COMMON_TESTS

* Rewrite tests with ALMModelTester/ALMModelTest common test pattern

* Fix: simplify conditional_generation_class assignment for check_repo regex

* Add AdaptorConfig and CtcConfig to docs

* Retrigger CI + remove build_chat_input from docs

* Add **kwargs to FunAsrNanoEncoder.forward for check_repo compatibility

* Add @auto_docstring with checkpoint to config classes

* Fix all config classes: use @strict + class-level annotations + @auto_docstring

* Document all config parameters for auto_docstring check

* Remove unused positional_dropout_rate from encoder config

* Add dates to model doc

* tests: add integration tests for FunAsrNano (generate Chinese/English)

* Fix FunAsrNano tests and audio processor

* Refactor fun_asr_nano to modular pattern; address review

- Add modular_fun_asr_nano.py as the canonical source; modeling/config/processing
  now generate from it (modular conversion in sync, idempotent).
- Rename encode_audio -> get_audio_features (audioflamingo3 convention), returning
  BaseModelOutputWithPooling; add a proper FunAsrNanoPreTrainedModel base class.
- Fold the adaptor params into the main config (Voxtral pattern); keep the encoder
  config standalone (Parakeet pattern); drop the unused CTC config/head (no CTC
  weights in the checkpoint, not on the generation path).
- Processor: drop custom batch_decode/decode forwarders and the default chat
  template; the chat template now lives in the checkpoint (chat_template.jinja),
  written by the convert script (vibevoice_asr pattern).
- Docs: add single/batch/training/torch.compile usage sections.
- Tests: real single/batch integration tests against the checkpoint (output
  byte-identical to the pre-refactor baseline).

* Fix fun_asr_nano model card contribution date (repo-consistency check)

* Refactor fun_asr_nano to modular pattern and fix checkpoint dtype

- Migrate the model to the modular pattern: split lm_head out of the base
  FunAsrNanoModel (mirroring AudioFlamingo3 / Voxtral), and regenerate
  modeling from modular.
- Move the audio feature extraction to a torch-based FunAsrNanoFeatureExtractor
  and tidy the processor.
- Fix the conversion script to emit a dtype-consistent bf16 checkpoint
  (cast every weight to bfloat16, set config.dtype=bfloat16). This shrinks
  the checkpoint from 2.75GB to 1.97GB, matching the LLM dtype. lm_head.weight
  is kept explicitly (deduplicated by safetensors against the tied embeddings),
  giving 0 missing / 0 unexpected keys on load.
- Make the integration test model id overridable via env for local checkpoint
  verification.

* fix(fun_asr_nano): declare tie_word_embeddings in config and refresh model card date

- Declare tie_word_embeddings on FunAsrNanoConfig (the model defines
  _tied_weights_keys, so the config must expose tie_word_embeddings per the
  modeling-structure rule TRF015).
- Refresh the model card contribution date (add_dates check).

* Address Fun-ASR-Nano processor review comments

* Fix Fun-ASR-Nano modular mask handling

* Fix Fun-ASR-Nano model doc date

* Fix Fun-ASR-Nano copyright years

* Generate Fun-ASR-Nano config from modular

* Generate Fun-ASR-Nano processor from modular

* Format Fun-ASR-Nano modular processor

* Use standard Fun-ASR-Nano config names

* Reuse sinusoidal position embedding helper

* Reuse audio chat-template normalization

* Document Fun-ASR-Nano conversion flow

* Guard Fun-ASR-Nano feature extractor imports

* Clarify Fun-ASR-Nano checkpoint key mapping

* Use real audio in Fun-ASR-Nano training docs

* Trim Fun-ASR-Nano config docstrings

* Reuse Llama eager attention in Fun-ASR-Nano

* Trigger Fun-ASR-Nano CI rerun

* Fix FunASR Nano processor isinstance style

* Fix FunASR Nano GPU test coverage

* Refactor Fun-ASR-Nano with shared audio components

* Fix FunASR Nano Bandit check

* Fix FunASR Nano quality checks

* Fix Fun-ASR-Nano model contribution date

* Address remaining Fun-ASR-Nano review feedback

* Address Fun-ASR-Nano integration review

* Remove redundant Fun-ASR-Nano config docs

* Fix legacy Fun-ASR-Nano checkpoint config loading

* Fix Fun-ASR-Nano config attribute usage

* Update Fun-ASR-Nano model date

* Adjust Fun-ASR-Nano offload test split

* Refresh Fun-ASR-Nano model doc date

* Address Fun-ASR-Nano modular review feedback

* Reuse AudioFlamingo3 processor call

* Align Fun-ASR-Nano processor review fixes

* Use Fun-ASR-Nano attention directly in adaptor

* Address Fun-ASR-Nano encoder review comments

* Add Fun-ASR-Nano adaptor subconfig

* Update Fun-ASR-Nano adaptor auto mapping

* Align Fun-ASR-Nano generated processor

* Sync Fun-ASR-Nano generated attention

* Export Fun-ASR-Nano adaptor config

* Document Fun-ASR-Nano adaptor config

* Allow derived Fun-ASR-Nano input attributes

* Update Fun-ASR-Nano model card date

* Separate config since doesn't need modular, and cleanup legacy args. Separate multimodal projector.

* Nit naming.

* Nit naming.

* Switch to ternary.

* refactor ternary

* Fix Fun-ASR-Nano consistency checks

Signed-off-by: LauraGPT <[email protected]>

* Fix Fun-ASR-Nano repository consistency

Signed-off-by: LauraGPT <[email protected]>

* Fix Fun-ASR-Nano legacy adaptor loading

Signed-off-by: LauraGPT <[email protected]>

* Address Fun-ASR-Nano review feedback

Signed-off-by: LauraGPT <[email protected]>

* Fix Fun-ASR-Nano batched transcription inputs

Signed-off-by: LauraGPT <[email protected]>

* Update Fun-ASR-Nano model contribution date

Signed-off-by: LauraGPT <[email protected]>

* Update Fun-ASR-Nano model date

Refresh the generated contribution date after synchronizing the model integration with current main.

Signed-off-by: LauraGPT <[email protected]>

* style: apply current Ruff formatting

Signed-off-by: LauraGPT <[email protected]>

* Update Fun-ASR-Nano model contribution date

Signed-off-by: LauraGPT <[email protected]>

* Update Fun-ASR-Nano documentation examples

Signed-off-by: LauraGPT <[email protected]>

* Align Fun-ASR-Nano with modeling conventions

Signed-off-by: LauraGPT <[email protected]>

* Regenerate Fun-ASR-Nano on current main

Signed-off-by: LauraGPT <[email protected]>

* Clean up tests, standarizing with Transformers conventions (modular, feature extractor, processor).

* Revert AF3 date.

* Fix Fun-ASR-Nano checkpoint fixtures

Signed-off-by: LauraGPT <[email protected]>

* Switch to new audio utils.

* feature extractor nits: naming and batched

* regenerate processor from modular

* regenerate processor from modeling

* nit refactor

* Fix Fun-ASR-Nano review nits

* Standardize Fun-ASR-Nano audio configuration

* Update Fun-ASR-Nano model card date

* Refactor Fun-ASR-Nano encoder components

* Refine Fun-ASR-Nano review feedback

Signed-off-by: LauraGPT <[email protected]>

* Fix Fun-ASR-Nano CI consistency checks

Signed-off-by: LauraGPT <[email protected]>

* Reference Fun-ASR-Nano audio input dimensions directly

Signed-off-by: LauraGPT <[email protected]>

* test: address Fun-ASR-Nano review nits

Cache the remote audio fixture and update the new model test copyright.

Signed-off-by: LauraGPT <[email protected]>

* Address comments, shared layer for encoder and adaptor, use more recent attribute names.

* better FunAsrNanoEncoderLayer, and nits

* fix: preserve optional Fun-ASR-Nano masks

Signed-off-by: LauraGPT <[email protected]>

* align with llama attentino

* modular after sync

* fuse layers in encoder.

* nits

* Modular nits

* fix: honor Fun-ASR-Nano attention and normalization configuration

Signed-off-by: zhifu gao <[email protected]>

* Remove second application of mask

* Address modular comments, and other nits.

* tests: use accelerator gate for FunASR Nano integration

Signed-off-by: LauraGPT <[email protected]>

* Address comments

* Fix Fun-ASR-Nano internal audio return type and cover projector kwargs

Signed-off-by: zhifu gao <[email protected]>

* Test Fun-ASR-Nano with the reconverted official checkpoint

Signed-off-by: zhifu gao <[email protected]>

* remove tests

* Set headdim for flash attention tests.

---------

Signed-off-by: LauraGPT <[email protected]>
Signed-off-by: LauraGPT <[email protected]>
Signed-off-by: LauraGPT <[email protected]>
Signed-off-by: zhifu gao <[email protected]>
Co-authored-by: xiaoyunchong.xyc <[email protected]>
Co-authored-by: LauraGPT <[email protected]>
Co-authored-by: Eric B <[email protected]>
Co-authored-by: LauraGPT <[email protected]>
Co-authored-by: Eric Bezzam <[email protected]>
…ssor default (PR #41388) (#48637)

* [tests] Fix integration test golden values broken by fast image processor default (PR #41388)

PR #41388 switched all models to use fast image processors by default, but 10 integration
tests still had golden logit/embedding values from the slow image processors. This updates
the expected values (and in one case, relaxes tolerance) to match the fast image processor
outputs.

Tests fixed:
- `FlavaModelIntegrationTest::test_inference` — image_embeddings and multimodal_embeddings sums
- `HieraModelIntegrationTest::test_inference_image_classification_head` — top-5 logit slice
- `LlavaNextForConditionalGenerationIntegrationTest::test_small_model_integration_test` — pixel values tolerance 1e-2 → 0.1
- `OwlViTModelIntegrationTest::test_inference_interpolate_pos_encoding` — logits + box slice, box tolerance 1e-4 → 1e-3
- `OwlViTModelIntegrationTest::test_inference_object_detection` — box slice, tolerance 1e-4 → 1e-3
- `OwlViTModelIntegrationTest::test_inference_one_shot_object_detection` — box slice, tolerance 1e-4 → 1e-3
- `PixioModelIntegrationTest::test_inference_no_head` — last_hidden_state slice
- `DonutModelIntegrationTest::test_inference_docvqa` — step 1 logits + step 2 generation scores
- `DonutModelIntegrationTest::test_inference_cordv2` — step 1 logits + step 2 generation scores
- `DonutModelIntegrationTest::test_inference_rvlcdip` — step 1 logits + step 2 generation scores

All 10 tests verified passing on GPU runner.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* [tests] Fix owlvit box tolerance and replace self.assertTrue(torch.allclose) with assert_close

- OwlViT box checks: confirm 1e-3 tolerance is needed (genuine GPU non-determinism of
  ~1e-3 verified by running twice; 1e-4 fails with max diff 0.0011)
- VisionEncoderDecoder: replace self.assertTrue(torch.allclose(..., atol=1e-4)) with
  torch.testing.assert_close(..., rtol=1e-4, atol=1e-4) for all 4 score checks
  (docvqa, cordv2, rvlcdip donut models + nougat)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* [tests] Update owlvit box golden values to pytest-context values, use 1e-4 tolerance

The previous expected values were captured from a standalone script (fresh GPU),
but the pytest context (3 tests run sequentially, prior models in GPU memory)
produces slightly different but fully deterministic float32 values.

Captured correct values by running 5 consecutive pytest invocations — all identical
(max diff = 0.0). Updated expected values to match pytest context and restored
the tight 1e-4 tolerance.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* format

---------

Co-authored-by: ydshieh <[email protected]>
…vaForPreTraining integration tests (#48639)

- test_inference: update mmm_text/mmm_image/loss golden values (drifted since 2025-01-25)
- test_inference_with_itm_labels: fix expected_logits shape from [2, 2] → [1, 2]
  to match the model's correct output (only positive pairs selected when itm_labels=[1,0]).
  The old [2,2] tensor accidentally passed via torch.allclose broadcasting (both rows were
  identical), but torch.testing.assert_close correctly catches the shape mismatch.
  Also update stale loss golden values.

Co-authored-by: ydshieh <[email protected]>
@pull pull Bot locked and limited conversation to collaborators Sep 9, 2026
@pull pull Bot added the ⤵️ pull label Sep 9, 2026
@pull
pull Bot merged commit 3283d5f into ZikrieHR:main Sep 9, 2026
1 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants