From ea03bf1f06c7448fd7d51eb70b819cc725ee0d20 Mon Sep 17 00:00:00 2001 From: Jaikinator Date: Fri, 10 Nov 2023 15:23:50 +0100 Subject: [PATCH] added variable to store params for possible reload --- scraibe/autotranscript.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scraibe/autotranscript.py b/scraibe/autotranscript.py index b3545e4..2664e3f 100644 --- a/scraibe/autotranscript.py +++ b/scraibe/autotranscript.py @@ -75,6 +75,11 @@ class Scraibe: Path to pyannote diarization model or model itself. **kwargs: Additional keyword arguments for whisper and pyannote diarization models. + e.g.: + + - verbose: If True, the class will print additional information. + - save_kwargs: If True, the keyword arguments will be saved + for autotranscribe. So you can unload the class and reload it again. """ @@ -98,6 +103,15 @@ class Scraibe: else: self.verbose = False + # Save kwargs for autotranscribe if you want to unload the class and load it again. + if kwargs.get('save_setup'): + self.params = dict(whisper_model = whisper_model, + dia_model = dia_model, + **kwargs) + else: + self.params = {} + + def autotranscribe(self, audio_file : Union[str, torch.Tensor, ndarray], remove_original : bool = False, **kwargs) -> Transcript: