From a423234c12c77a72177316a1487c9b28447a3646 Mon Sep 17 00:00:00 2001
From: Eustache Le Bihan <eulebihan@gmail.com>
Date: Tue, 13 Aug 2024 21:06:44 +0000
Subject: [PATCH] clean code

---
 utils.py | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/utils.py b/utils.py
index 6ad672c..6a353c7 100644
--- a/utils.py
+++ b/utils.py
@@ -1,16 +1,5 @@
-import torch
-import numpy as np
-
-import math
-from queue import Queue
-from typing import Optional
-
 import numpy as np
 import torch
-from time import perf_counter
-
-from parler_tts import ParlerTTSForConditionalGeneration
-from transformers.generation.streamers import BaseStreamer
 
 
 def next_power_of_2(x):  
@@ -18,6 +7,10 @@ def next_power_of_2(x):
 
 
 def int2float(sound):
+    """
+    Taken from https://github.com/snakers4/silero-vad
+    """
+
     abs_max = np.abs(sound).max()
     sound = sound.astype('float32')
     if abs_max > 0:
@@ -36,6 +29,7 @@ class VADIterator:
                  ):
 
         """
+        Mainly taken from https://github.com/snakers4/silero-vad
         Class for stream imitation
 
         Parameters
-- 
GitLab