mirror of
https://github.com/mudler/LocalAI.git
synced 2026-05-29 11:07:18 -04:00
* fix(nemo): extract Hypothesis.text for TDT/RNNT ASR models CTC models (e.g. Whisper) return List[str] from transcribe(), but TDT/RNNT models (e.g. parakeet-tdt-0.6b-v3) return List[Hypothesis] where the decoded text lives in the Hypothesis.text attribute. Previously, results[0] was assigned directly to the protobuf string field, causing silent empty output for non-CTC models. Now checks the return type and extracts .text from Hypothesis objects, with a safe fallback via getattr(). * refactor: simplify Hypothesis text extraction per Copilot review Use single getattr() call instead of hasattr() + double access, and return empty string for unknown types instead of str(result) to avoid leaking internal repr to clients.
5.2 KiB
5.2 KiB