From ae16b5522ab71c0419c401b4740274e889e02bc8 Mon Sep 17 00:00:00 2001 From: jhj0517 <97279763+jhj0517@users.noreply.github.com> Date: Sun, 14 Jul 2024 01:08:20 +0900 Subject: [PATCH] set to `None` for empty Textbox values --- modules/whisper/faster_whisper_inference.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/whisper/faster_whisper_inference.py b/modules/whisper/faster_whisper_inference.py index 3ad4fcbb..9d8bdeb6 100644 --- a/modules/whisper/faster_whisper_inference.py +++ b/modules/whisper/faster_whisper_inference.py @@ -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(