From f2d81f88d3d81a1b26d7f461391570818d53e0d6 Mon Sep 17 00:00:00 2001 From: lipku Date: Fri, 26 Apr 2024 23:30:07 +0800 Subject: [PATCH] fix cors problem --- asrreal.py | 6 +++--- web/chat.html | 2 +- web/echo.html | 2 +- web/webrtc.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/asrreal.py b/asrreal.py index e29b3eb..080c4b2 100644 --- a/asrreal.py +++ b/asrreal.py @@ -122,7 +122,7 @@ class ASR: self.att_feats = [torch.zeros(self.audio_dim, 16, dtype=torch.float32, device=self.device)] * 4 # 4 zero padding... # warm up steps needed: mid + right + window_size + attention_size - self.warm_up_steps = self.context_size + self.stride_right_size #+ self.stride_left_size #+ 8 + 2 * 3 + self.warm_up_steps = self.context_size + self.stride_left_size + self.stride_right_size #+ self.stride_left_size #+ 8 + 2 * 3 self.listening = False self.playing = False @@ -385,8 +385,8 @@ class ASR: self.inwarm = True print(f'[INFO] warm up ASR live model, expected latency = {self.warm_up_steps / self.fps:.6f}s') t = time.time() - for _ in range(self.stride_left_size): - self.frames.append(np.zeros(self.chunk, dtype=np.float32)) + #for _ in range(self.stride_left_size): + # self.frames.append(np.zeros(self.chunk, dtype=np.float32)) for _ in range(self.warm_up_steps): self.run_step() #if torch.cuda.is_available(): diff --git a/web/chat.html b/web/chat.html index bb117f8..aa189ac 100644 --- a/web/chat.html +++ b/web/chat.html @@ -3,7 +3,7 @@ - + diff --git a/web/echo.html b/web/echo.html index f687c4e..9899a04 100644 --- a/web/echo.html +++ b/web/echo.html @@ -3,7 +3,7 @@ - + diff --git a/web/webrtc.html b/web/webrtc.html index 008a808..c55a816 100644 --- a/web/webrtc.html +++ b/web/webrtc.html @@ -48,7 +48,7 @@ - +