Skip to content

Add inputs_to_logits_ratio to LasrCTCConfig#42720

Merged
eustlb merged 6 commits intohuggingface:mainfrom
kho:inputs_to_logits_ratio
Dec 12, 2025
Merged

Add inputs_to_logits_ratio to LasrCTCConfig#42720
eustlb merged 6 commits intohuggingface:mainfrom
kho:inputs_to_logits_ratio

Conversation

@kho
Copy link
Copy Markdown
Contributor

@kho kho commented Dec 8, 2025

What does this PR do?

This PR adds inputs_to_logits_ratio to LasrCTCConfig so that LasrForCTC can be used in an ASR pipeline with chunked decoding.

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?

@kho
Copy link
Copy Markdown
Contributor Author

kho commented Dec 8, 2025

@eustlb make fixup is not yet passing due to hop_length not being used in modelling code.

@pcuenca pcuenca requested a review from eustlb December 10, 2025 09:11
Copy link
Copy Markdown
Contributor

@eustlb eustlb left a comment

Choose a reason for hiding this comment

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

hop_length should be accessed directly from the feature extractor. @kho do you confirm this suits your needs?

@kho
Copy link
Copy Markdown
Contributor Author

kho commented Dec 10, 2025

Unfortunately this will break decoding with LM. Perhaps we should just hardcode hop_length to a fixed value for now in LasrFeatureExtractor?

@kho
Copy link
Copy Markdown
Contributor Author

kho commented Dec 10, 2025

@eustlb I created #42782 as a Plan B. What do you think?

@kho kho force-pushed the inputs_to_logits_ratio branch from db37839 to ed579ba Compare December 11, 2025 19:31
Copy link
Copy Markdown
Contributor

@eustlb eustlb left a comment

Choose a reason for hiding this comment

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

Thanks for updating!

Comment thread tests/models/lasr/test_modeling_lasr.py Outdated
Comment on lines +391 to +405

@slow
@unittest.skip(reason="TODO when checkpoint")
def test_model_integration_pipe_with_chunk(self):
EXPECTED_TRANSCRIPTIONS = [
{"text": "Mr. Kuer is thele of the middle classes and we are glad to welcome his gosal.</s>"}
]

samples = self._load_datasamples(1)
pipe = pipeline(
task="automatic-speech-recognition", model=self.checkpoint_name, dtype=self.dtype, device_map=torch_device
)
self.assertEqual(pipe.type, "ctc")
predicted_transcripts = pipe(samples, chunk_length_s=3, stride_length_s=1)
self.assertListEqual(predicted_transcripts, EXPECTED_TRANSCRIPTIONS)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to be added in another PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to #42823.

@eustlb eustlb enabled auto-merge (squash) December 12, 2025 13:56
@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: lasr

@eustlb eustlb merged commit 65dc261 into huggingface:main Dec 12, 2025
25 checks passed
@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.

SangbumChoi pushed a commit to SangbumChoi/transformers that referenced this pull request Jan 23, 2026
* Add inputs_to_logits_ratio to LasrCTCConfig

* changes

* nit

* update

* Add an _align_to property to unify stride computation in AutomaticSpeechRecognition pipeline

---------

Co-authored-by: Eustache Le Bihan <eulebihan@gmail.com>
Co-authored-by: eustlb <94853470+eustlb@users.noreply.github.com>
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