copy np array to make tensor writable

This commit is contained in:
makaveli10
2023-07-03 18:51:28 +08:00
parent 4352df745f
commit 1ac9bbaf3a
+1 -1
View File
@@ -109,7 +109,7 @@ class ServeClient:
def add_frames(self, frame_np):
try:
speech_prob = self.vad_model(torch.from_numpy(frame_np), self.RATE).item()
speech_prob = self.vad_model(torch.from_numpy(frame_np.copy()), self.RATE).item()
if speech_prob < self.vad_threshold:
return