From 95073dd8de38c11542161dee4cbfa47af8774f07 Mon Sep 17 00:00:00 2001 From: jhj0517 <97279763+jhj0517@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:57:21 +0900 Subject: [PATCH] Add Segment model --- modules/whisper/data_classes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/whisper/data_classes.py b/modules/whisper/data_classes.py index 878aaf1..247a62e 100644 --- a/modules/whisper/data_classes.py +++ b/modules/whisper/data_classes.py @@ -16,6 +16,15 @@ class WhisperImpl(Enum): INSANELY_FAST_WHISPER = "insanely_fast_whisper" +class Segment(BaseModel): + text: Optional[str] = Field(default=None, + description="Transcription text of the segment") + start: Optional[float] = Field(default=None, + description="Start time of the segment") + end: Optional[float] = Field(default=None, + description="End time of the segment") + + class BaseParams(BaseModel): model_config = ConfigDict(protected_namespaces=())