凌匀
2023-02-28 3388361d3b4b3123a02ab8db254e3641bb9c9fd4
funasr/models/e2e_vad.py
@@ -444,7 +444,7 @@
    def forward(self, feats: torch.Tensor, waveform: torch.tensor, in_cache: Dict[str, torch.Tensor] = dict(),
                is_final: bool = False
                ) -> List[List[List[int]]]:
                ) -> Tuple[List[List[List[int]]], Dict[str, torch.Tensor]]:
        self.waveform = waveform  # compute decibel for each frame
        self.ComputeDecibel()
        self.ComputeScores(feats, in_cache)
@@ -468,8 +468,7 @@
        if is_final:
            # reset class variables and clear the dict for the next query
            self.AllResetDetection()
            in_cache.clear()
        return segments
        return segments, in_cache
    def DetectCommonFrames(self) -> int:
        if self.vad_state_machine == VadStateMachine.kVadInStateEndPointDetected: