Skip to content

Commit

Permalink
set to None for empty Textbox values
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj0517 committed Jul 13, 2024
1 parent 79933ea commit ae16b55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/whisper/faster_whisper_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ def transcribe(self,
if params.model_size != self.current_model_size or self.model is None or self.current_compute_type != params.compute_type:
self.update_model(params.model_size, params.compute_type, progress)

# None parameters with Textboxes: https://github.com/gradio-app/gradio/issues/8723
if not params.initial_prompt:
params.initial_prompt = None
if not params.prefix:
params.prefix = None
if not params.hotwords:
params.hotwords = None

params.suppress_tokens = self.format_suppress_tokens_str(params.suppress_tokens)

segments, info = self.model.transcribe(
Expand Down

0 comments on commit ae16b55

Please sign in to comment.