Skip to content

Commit

Permalink
Merge branch 'main' into funasr1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraGPT authored Jan 18, 2024
2 parents 8977176 + b28f3c9 commit 9091e7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions funasr/models/fsmn_vad_streaming/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ def forward(self, feats: torch.Tensor, waveform: torch.tensor, cache: dict = {},
# self.AllResetDetection()
return segments

def init_cache(self, cache: dict = {}):

def init_cache(self, cache: dict = {}, **kwargs):

cache["frontend"] = {}
cache["prev_samples"] = torch.empty(0)
cache["encoder"] = {}
Expand All @@ -528,9 +530,9 @@ def inference(self,
cache: dict = {},
**kwargs,
):
# cache = kwargs.get("cache", {})

if len(cache) == 0:
self.init_cache(cache)
self.init_cache(cache, **kwargs)

meta_data = {}
chunk_size = kwargs.get("chunk_size", 60000) # 50ms
Expand Down

0 comments on commit 9091e7a

Please sign in to comment.