jhj0517 commited on
Commit
81cd5f6
·
1 Parent(s): 4328c6a

add debugging function

Browse files
Files changed (2) hide show
  1. app.py +26 -28
  2. modules/whisper/whisper_base.py +1 -1
app.py CHANGED
@@ -133,36 +133,34 @@ class App:
133
 
134
  params = [input_file, dd_file_format, cb_timestamp]
135
 
136
- whisper_params = [
137
- dd_model,
138
- dd_lang,
139
- cb_translate,
140
- nb_beam_size,
141
- nb_log_prob_threshold,
142
- nb_no_speech_threshold,
143
- dd_compute_type,
144
- nb_best_of,
145
- nb_patience,
146
- cb_condition_on_previous_text,
147
- tb_initial_prompt,
148
- sd_temperature,
149
- nb_compression_ratio_threshold,
150
- cb_vad_filter,
151
- sd_threshold,
152
- nb_min_speech_duration_ms,
153
- nb_max_speech_duration_s,
154
- nb_min_silence_duration_ms,
155
- nb_window_size_sample,
156
- nb_speech_pad_ms,
157
- nb_chunk_length_s,
158
- nb_batch_size,
159
- cb_diarize,
160
- tb_hf_token,
161
- dd_diarization_device
162
- ]
163
 
164
  btn_run.click(fn=self.whisper_inf.transcribe_file,
165
- inputs=params + whisper_params,
166
  outputs=[tb_indicator, files_subtitles])
167
  dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
168
 
 
133
 
134
  params = [input_file, dd_file_format, cb_timestamp]
135
 
136
+ whisper_params = WhisperParameters(model_size=dd_model,
137
+ lang=dd_lang,
138
+ is_translate=cb_translate,
139
+ beam_size=nb_beam_size,
140
+ log_prob_threshold=nb_log_prob_threshold,
141
+ no_speech_threshold=nb_no_speech_threshold,
142
+ compute_type=dd_compute_type,
143
+ best_of=nb_best_of,
144
+ patience=nb_patience,
145
+ condition_on_previous_text=cb_condition_on_previous_text,
146
+ initial_prompt=tb_initial_prompt,
147
+ temperature=sd_temperature,
148
+ compression_ratio_threshold=nb_compression_ratio_threshold,
149
+ vad_filter=cb_vad_filter,
150
+ threshold=sd_threshold,
151
+ min_speech_duration_ms=nb_min_speech_duration_ms,
152
+ max_speech_duration_s=nb_max_speech_duration_s,
153
+ min_silence_duration_ms=nb_min_silence_duration_ms,
154
+ window_size_sample=nb_window_size_sample,
155
+ speech_pad_ms=nb_speech_pad_ms,
156
+ chunk_length_s=nb_chunk_length_s,
157
+ batch_size=nb_batch_size,
158
+ is_diarize=cb_diarize,
159
+ hf_token=tb_hf_token,
160
+ diarization_device=dd_diarization_device)
 
 
161
 
162
  btn_run.click(fn=self.whisper_inf.transcribe_file,
163
+ inputs=params,
164
  outputs=[tb_indicator, files_subtitles])
165
  dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
166
 
modules/whisper/whisper_base.py CHANGED
@@ -132,7 +132,7 @@ class WhisperBase(ABC):
132
  file_format: str,
133
  add_timestamp: bool,
134
  progress=gr.Progress(),
135
- *whisper_params,
136
  ) -> list:
137
  """
138
  Write subtitle file from Files
 
132
  file_format: str,
133
  add_timestamp: bool,
134
  progress=gr.Progress(),
135
+ #*whisper_params,
136
  ) -> list:
137
  """
138
  Write subtitle file from Files