Skip to content

fix(SpeechT5Config): missing annotation on inputs_to_logits_ratio property#41132

Open
sw00 wants to merge 2 commits intohuggingface:mainfrom
Lelapa-AI:fix/speecht5-asr-pipeline-chunking
Open

fix(SpeechT5Config): missing annotation on inputs_to_logits_ratio property#41132
sw00 wants to merge 2 commits intohuggingface:mainfrom
Lelapa-AI:fix/speecht5-asr-pipeline-chunking

Conversation

@sw00
Copy link
Copy Markdown

@sw00 sw00 commented Sep 24, 2025

What does this PR do?

Add the missing @property annotation on SpeechT5Config which causes failures on AutomaticSpeechRecognitionPipeline's preprocessing steps if chunk_length_s is specified.

Specifically, the following line of code will fail since getattr will resolve to a method instead of the value:

align_to = getattr(self.model.config, "inputs_to_logits_ratio", 1)

This stacktrace is generated on this error:

Traceback (most recent call last):
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/litserve/loops/simple_loops.py", line 88, in run_single_loop
    y = _inject_context(
        ^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/litserve/loops/base.py", line 48, in _inject_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/src/omniserve/api.py", line 19, in predict
    return self.model.predict(audio_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/src/omniserve/model.py", line 63, in predict
    output = self.pipeline(input)
             ^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 275, in __call__
    return super().__call__(inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/base.py", line 1459, in __call__
    return next(
           ^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/pt_utils.py", line 126, in __next__
    item = next(self.iterator)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/pt_utils.py", line 271, in __next__
    processed = self.infer(next(self.iterator), **self.params)
                           ^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 734, in __next__
    data = self._next_data()
           ^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 790, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch
    data.append(next(self.dataset_iter))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/pt_utils.py", line 188, in __next__
    processed = next(self.subiterator)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sett/src/model-cloud/servers/omniserve/.venv/lib/python3.12/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 450, in preprocess
    chunk_len = int(round(chunk_length_s * self.feature_extractor.sampling_rate / align_to) * align_to)
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'float' and 'method'

Fixes # (issue)

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?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@Rocketknight1 @eustlb

@sw00 sw00 force-pushed the fix/speecht5-asr-pipeline-chunking branch from eb9263c to 47c47d4 Compare September 25, 2025 09:05
Copy link
Copy Markdown
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Yep, this is an obvious bug. Thank you for the fix!

@sw00 sw00 force-pushed the fix/speecht5-asr-pipeline-chunking branch from 47c47d4 to 3fbf011 Compare September 25, 2025 14:16
@Rocketknight1
Copy link
Copy Markdown
Member

Not sure why CircleCI is failing - @ydshieh can you force-merge this? It's a one-line fix that shouldn't cause problems.

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: speecht5

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.

2 participants