MCPcopy
hub / github.com/huggingface/parler-tts / end

Method end

parler_tts/streamer.py:124–131  ·  view source on GitHub ↗

Flushes any remaining cache and appends the stop symbol.

(self)

Source from the content-addressed store, hash-verified

122 self.to_yield += len(audio_values) - self.to_yield - self.stride
123
124 def end(self):
125 """Flushes any remaining cache and appends the stop symbol."""
126 if self.token_cache is not None:
127 audio_values = self.apply_delay_pattern_mask(self.token_cache)
128 else:
129 audio_values = np.zeros(self.to_yield)
130
131 self.on_finalized_audio(audio_values[self.to_yield :], stream_end=True)
132
133 def on_finalized_audio(self, audio: np.ndarray, stream_end: bool = False):
134 """Put the new audio in the queue. If the stream is ending, also put a stop signal in the queue."""

Callers

nothing calls this directly

Calls 2

on_finalized_audioMethod · 0.95

Tested by

no test coverage detected