Update modules/vad/silero_vad.py
Browse files- modules/vad/silero_vad.py +13 -0
modules/vad/silero_vad.py
CHANGED
@@ -9,6 +9,19 @@ import faster_whisper
|
|
9 |
from faster_whisper.transcribe import SpeechTimestampsMap
|
10 |
import gradio as gr
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
class SileroVAD:
|
13 |
def __init__(self):
|
14 |
self.sampling_rate = 16000
|
|
|
9 |
from faster_whisper.transcribe import SpeechTimestampsMap
|
10 |
import gradio as gr
|
11 |
|
12 |
+
class Segment(BaseModel):
|
13 |
+
id: Optional[int] = Field(default=None, description="Incremental id for the segment")
|
14 |
+
seek: Optional[int] = Field(default=None, description="Seek of the segment from chunked audio")
|
15 |
+
text: Optional[str] = Field(default=None, description="Transcription text of the segment")
|
16 |
+
start: Optional[float] = Field(default=None, description="Start time of the segment")
|
17 |
+
end: Optional[float] = Field(default=None, description="End time of the segment")
|
18 |
+
tokens: Optional[List[int]] = Field(default=None, description="List of token IDs")
|
19 |
+
temperature: Optional[float] = Field(default=None, description="Temperature used during the decoding process")
|
20 |
+
avg_logprob: Optional[float] = Field(default=None, description="Average log probability of the tokens")
|
21 |
+
compression_ratio: Optional[float] = Field(default=None, description="Compression ratio of the segment")
|
22 |
+
no_speech_prob: Optional[float] = Field(default=None, description="Probability that it's not speech")
|
23 |
+
words: Optional[List['Word']] = Field(default=None, description="List of words contained in the segment")
|
24 |
+
|
25 |
class SileroVAD:
|
26 |
def __init__(self):
|
27 |
self.sampling_rate = 16000
|