Skip to content

Commit

Permalink
Merge pull request #210 from jhj0517/fix/text-none-parameters
Browse files Browse the repository at this point in the history
set to `None` for empty Textbox values
  • Loading branch information
jhj0517 authored Jul 13, 2024
2 parents e4c9d55 + ae16b55 commit f22356a
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 f22356a

Please sign in to comment.