For now, after looking into this, it seems quite likely that the issue is related to a bug on the FunASR side:
I do not think your intended setup is fundamentally unsupported.
The current funasr/paraformer-zh Hugging Face model card explicitly shows the full pipeline with VAD, punctuation, and speaker diarization, and says that the output includes timestamps and speaker labels. So I would not abandon the HF route or the diarization goal just because of this error.
What I found is closer to two separate timestamp-related problems in FunASR, plus a secondary output-schema issue.
The cheapest first test is simply:
result = model.generate(
input=audio,
pred_timestamp=True,
)
In controlled reproductions with the HF Paraformer model, this was enough to change the ASR result from no timestamp to timestamp present, on both CPU and T4.
So, for practical debugging, I would start there before changing the model stack.
A rough decision flow is:
add pred_timestamp=True
|
+-- still no timestamp
| -> check which model/config actually resolved
|
+-- timestamp appears
|
+-- timestamps stay within the audio duration
| -> continue checking the speaker pipeline
|
+-- timestamps extend well beyond the audio duration
-> likely the separate GPU dynamic-batching issue below
There is also a public reproduction notebook here:
- Why the missing timestamp looks like an internal FunASR integration issueSo my default route would be:
pred_timestamp=True
KeyError: 'text'
after missing timestamps as likely secondary, and inspect the actual sentence_info
keys rather than assuming the documented schema was reached.So, at least from these reproductions, this looks much more like a couple of FunASR integration/length-handling bugs that can be separated and worked around than a reason to give up on what you are trying to build.