Update app.py
Browse files
app.py
CHANGED
|
@@ -65,8 +65,7 @@ class App:
|
|
| 65 |
def __init__(self, args):
|
| 66 |
self.args = args
|
| 67 |
#self.app = gr.Blocks(css=CSS, theme=self.args.theme, delete_cache=(60, 3600))
|
| 68 |
-
|
| 69 |
-
self.app = gr.Blocks(css=CSS,theme=gr.themes.Ocean(), title="Whisper - Automatic speech recognition", delete_cache=(60, 3600))
|
| 70 |
self.whisper_inf = WhisperFactory.create_whisper_inference(
|
| 71 |
whisper_type=self.args.whisper_type,
|
| 72 |
whisper_model_dir=self.args.whisper_model_dir,
|
|
@@ -98,19 +97,24 @@ class App:
|
|
| 98 |
nllb_params = translation_params["nllb"]
|
| 99 |
|
| 100 |
with gr.Row():
|
| 101 |
-
with gr.Column(scale=
|
| 102 |
with gr.Row():
|
| 103 |
dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],label="Model", info="Larger models will increase the quality of the transcription, but reduce performance", interactive=True)
|
| 104 |
dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="If the language is known upfront, always set it manually", interactive=True)
|
| 105 |
cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English",interactive=True, visible=False)
|
| 106 |
#dd_file_format = gr.Dropdown(choices=["SRT", "WebVTT", "txt"], value="SRT", label="File Format")
|
| 107 |
dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", info="Output preview format", interactive=True, visible=False)
|
| 108 |
-
|
| 109 |
dd_translate_model = gr.Dropdown(choices=self.nllb_inf.available_models, value=nllb_params["model_size"],label="Model", info="Model used for translation", interactive=True)
|
| 110 |
dd_target_lang = gr.Dropdown(choices=["English","Dutch","French","German"], value=nllb_params["target_lang"],label="Language", info="Language used for output translation", interactive=True)
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
# with gr.Accordion("Speaker diarization", open=False, visible=True):
|
| 116 |
# cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"], label="Use diarization",interactive=True)
|
|
|
|
| 65 |
def __init__(self, args):
|
| 66 |
self.args = args
|
| 67 |
#self.app = gr.Blocks(css=CSS, theme=self.args.theme, delete_cache=(60, 3600))
|
| 68 |
+
self.app = gr.Blocks(css=CSS,theme=gr.themes.Ocean(), title="Automatic speech recognition", delete_cache=(60, 3600))
|
|
|
|
| 69 |
self.whisper_inf = WhisperFactory.create_whisper_inference(
|
| 70 |
whisper_type=self.args.whisper_type,
|
| 71 |
whisper_model_dir=self.args.whisper_model_dir,
|
|
|
|
| 97 |
nllb_params = translation_params["nllb"]
|
| 98 |
|
| 99 |
with gr.Row():
|
| 100 |
+
with gr.Column(scale=2):
|
| 101 |
with gr.Row():
|
| 102 |
dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],label="Model", info="Larger models will increase the quality of the transcription, but reduce performance", interactive=True)
|
| 103 |
dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="If the language is known upfront, always set it manually", interactive=True)
|
| 104 |
cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English",interactive=True, visible=False)
|
| 105 |
#dd_file_format = gr.Dropdown(choices=["SRT", "WebVTT", "txt"], value="SRT", label="File Format")
|
| 106 |
dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", info="Output preview format", interactive=True, visible=False)
|
| 107 |
+
with gr.Column(scale=2):
|
| 108 |
dd_translate_model = gr.Dropdown(choices=self.nllb_inf.available_models, value=nllb_params["model_size"],label="Model", info="Model used for translation", interactive=True)
|
| 109 |
dd_target_lang = gr.Dropdown(choices=["English","Dutch","French","German"], value=nllb_params["target_lang"],label="Language", info="Language used for output translation", interactive=True)
|
| 110 |
+
|
| 111 |
+
with gr.Row():
|
| 112 |
+
with gr.Column(scale=2):
|
| 113 |
+
with gr.Row():
|
| 114 |
+
cb_timestamp = gr.Checkbox(value=whisper_params["add_timestamp"], label="Add timestamp to output file",interactive=True)
|
| 115 |
+
with gr.Column(scale=2):
|
| 116 |
+
with gr.Row():
|
| 117 |
+
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate output",interactive=True)
|
| 118 |
|
| 119 |
# with gr.Accordion("Speaker diarization", open=False, visible=True):
|
| 120 |
# cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"], label="Use diarization",interactive=True)
|