LAP-DEV commited on
Commit
661d8d8
·
verified ·
1 Parent(s): b58c6d8

Update modules/whisper/whisper_parameter.py

Browse files
modules/whisper/whisper_parameter.py CHANGED
@@ -52,6 +52,8 @@ class WhisperParameters:
52
  uvr_segment_size: gr.Number
53
  uvr_save_file: gr.Checkbox
54
  uvr_enable_offload: gr.Checkbox
 
 
55
  """
56
  A data class for Gradio components of the Whisper Parameters. Use "before" Gradio pre-processing.
57
  This data class is used to mitigate the key-value problem between Gradio components and function parameters.
@@ -223,6 +225,12 @@ class WhisperParameters:
223
  uvr_enable_offload: gr.Checkbox
224
  This parameter is related to UVR. Boolean value that determines whether to offload the UVR model or not
225
  after each transcription.
 
 
 
 
 
 
226
  """
227
 
228
  def as_list(self) -> list:
@@ -298,6 +306,8 @@ class WhisperValues:
298
  uvr_segment_size: int = 256
299
  uvr_save_file: bool = False
300
  uvr_enable_offload: bool = True
 
 
301
  """
302
  A data class to use Whisper parameters.
303
  """
@@ -335,6 +345,7 @@ class WhisperValues:
335
  "hotwords": None if not self.hotwords else self.hotwords,
336
  "language_detection_threshold": self.language_detection_threshold,
337
  "language_detection_segments": self.language_detection_segments,
 
338
  },
339
  "vad": {
340
  "vad_filter": self.vad_filter,
@@ -347,6 +358,7 @@ class WhisperValues:
347
  "diarization": {
348
  "is_diarize": self.is_diarize,
349
  "hf_token": self.hf_token
 
350
  },
351
  "bgm_separation": {
352
  "is_separate_bgm": self.is_bgm_separate,
 
52
  uvr_segment_size: gr.Number
53
  uvr_save_file: gr.Checkbox
54
  uvr_enable_offload: gr.Checkbox
55
+ whisper_enable_offload: gr.Checkbox
56
+ diarization_enable_offload: gr.Checkbox
57
  """
58
  A data class for Gradio components of the Whisper Parameters. Use "before" Gradio pre-processing.
59
  This data class is used to mitigate the key-value problem between Gradio components and function parameters.
 
225
  uvr_enable_offload: gr.Checkbox
226
  This parameter is related to UVR. Boolean value that determines whether to offload the UVR model or not
227
  after each transcription.
228
+
229
+ whisper_enable_offload: gr.Checkbox
230
+ This parameter is related to Whisper. Boolean value that determines whether to offload the Whisper model.
231
+
232
+ diarization_enable_offload: gr.Checkbox
233
+ This parameter is related to diarization. Boolean value that determines whether to offload the diarization model.
234
  """
235
 
236
  def as_list(self) -> list:
 
306
  uvr_segment_size: int = 256
307
  uvr_save_file: bool = False
308
  uvr_enable_offload: bool = True
309
+ whisper_enable_offload: bool = True
310
+ diarization_enable_offload: bool = True
311
  """
312
  A data class to use Whisper parameters.
313
  """
 
345
  "hotwords": None if not self.hotwords else self.hotwords,
346
  "language_detection_threshold": self.language_detection_threshold,
347
  "language_detection_segments": self.language_detection_segments,
348
+ "enable_offload": self.whisper_enable_offload
349
  },
350
  "vad": {
351
  "vad_filter": self.vad_filter,
 
358
  "diarization": {
359
  "is_diarize": self.is_diarize,
360
  "hf_token": self.hf_token
361
+ "enable_offload": self.diarization_enable_offload
362
  },
363
  "bgm_separation": {
364
  "is_separate_bgm": self.is_bgm_separate,