Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix decoding_ind none bug

haoneng.lhn2165d5de05f4
diff --git a/funasr/bin/asr_infer.py b/funasr/bin/asr_infer.py
index 79ab974ee..3d72ec4e2 100644
--- a/funasr/bin/asr_infer.py
+++ b/funasr/bin/asr_infer.py
@@ -430,9 +430,7 @@ class Speech2TextParaformer:
# b. Forward Encoder
if decoding_ind is None:
- decoding_ind = self.decoding_ind
- if self.decoding_ind is None:
- decoding_ind = 0
+ decoding_ind = 0 if self.decoding_ind is None else self.decoding_ind
enc, enc_len = self.asr_model.encode(**batch, ind=decoding_ind)
if isinstance(enc, tuple):
enc = enc[0]