Spaces:
Paused
Paused
makaveli10
commited on
Commit
•
022421b
1
Parent(s):
674148d
clean up trt_server
Browse files- whisper_live/trt_server.py +0 -22
whisper_live/trt_server.py
CHANGED
@@ -211,18 +211,8 @@ class ServeClient:
|
|
211 |
timestamp_offset (float): The offset in audio timestamps.
|
212 |
frames_np (numpy.ndarray): NumPy array to store audio frames.
|
213 |
frames_offset (float): The offset in audio frames.
|
214 |
-
text (list): List of transcribed text segments.
|
215 |
-
current_out (str): The current incomplete transcription.
|
216 |
-
prev_out (str): The previous incomplete transcription.
|
217 |
-
t_start (float): Timestamp for the start of transcription.
|
218 |
exit (bool): A flag to exit the transcription thread.
|
219 |
-
same_output_threshold (int): Threshold for consecutive same output segments.
|
220 |
-
show_prev_out_thresh (int): Threshold for showing previous output segments.
|
221 |
-
add_pause_thresh (int): Threshold for adding a pause (blank) segment.
|
222 |
transcript (list): List of transcribed segments.
|
223 |
-
send_last_n_segments (int): Number of last segments to send to the client.
|
224 |
-
wrapper (textwrap.TextWrapper): Text wrapper for formatting text.
|
225 |
-
pick_previous_segments (int): Number of previous segments to include in the output.
|
226 |
websocket: The WebSocket connection for the client.
|
227 |
"""
|
228 |
RATE = 16000
|
@@ -270,23 +260,11 @@ class ServeClient:
|
|
270 |
self.timestamp_offset = 0.0
|
271 |
self.frames_np = None
|
272 |
self.frames_offset = 0.0
|
273 |
-
self.text = []
|
274 |
-
self.current_out = ''
|
275 |
-
self.prev_out = ''
|
276 |
-
self.t_start=None
|
277 |
self.exit = False
|
278 |
-
self.same_output_threshold = 0
|
279 |
-
self.show_prev_out_thresh = 5 # if pause(no output from whisper) show previous output for 5 seconds
|
280 |
-
self.add_pause_thresh = 3 # add a blank to segment list as a pause(no speech) for 3 seconds
|
281 |
self.transcript = []
|
282 |
self.prompt = None
|
283 |
-
self.send_last_n_segments = 10
|
284 |
self.segment_inference_time = []
|
285 |
|
286 |
-
# text formatting
|
287 |
-
self.wrapper = textwrap.TextWrapper(width=50)
|
288 |
-
self.pick_previous_segments = 2
|
289 |
-
|
290 |
# threading
|
291 |
self.websocket = websocket
|
292 |
self.lock = threading.Lock()
|
|
|
211 |
timestamp_offset (float): The offset in audio timestamps.
|
212 |
frames_np (numpy.ndarray): NumPy array to store audio frames.
|
213 |
frames_offset (float): The offset in audio frames.
|
|
|
|
|
|
|
|
|
214 |
exit (bool): A flag to exit the transcription thread.
|
|
|
|
|
|
|
215 |
transcript (list): List of transcribed segments.
|
|
|
|
|
|
|
216 |
websocket: The WebSocket connection for the client.
|
217 |
"""
|
218 |
RATE = 16000
|
|
|
260 |
self.timestamp_offset = 0.0
|
261 |
self.frames_np = None
|
262 |
self.frames_offset = 0.0
|
|
|
|
|
|
|
|
|
263 |
self.exit = False
|
|
|
|
|
|
|
264 |
self.transcript = []
|
265 |
self.prompt = None
|
|
|
266 |
self.segment_inference_time = []
|
267 |
|
|
|
|
|
|
|
|
|
268 |
# threading
|
269 |
self.websocket = websocket
|
270 |
self.lock = threading.Lock()
|