Spaces:
Running
Running
jhj0517
commited on
Commit
·
f4c648c
1
Parent(s):
633c360
Remove duplicates parameter
Browse files
app.py
CHANGED
|
@@ -113,7 +113,7 @@ class App:
|
|
| 113 |
nb_max_new_tokens = gr.Number(label="Max New Tokens", value=lambda: whisper_params["max_new_tokens"],
|
| 114 |
precision=0,
|
| 115 |
info="Maximum number of new tokens to generate per-chunk. If not set, the maximum will be set by the default max_length.")
|
| 116 |
-
nb_chunk_length = gr.Number(label="Chunk Length", value=lambda: whisper_params["chunk_length"],
|
| 117 |
precision=0,
|
| 118 |
info="The length of audio segments. If it is not None, it will overwrite the default chunk_length of the FeatureExtractor.")
|
| 119 |
nb_hallucination_silence_threshold = gr.Number(label="Hallucination Silence Threshold (sec)",
|
|
@@ -127,8 +127,6 @@ class App:
|
|
| 127 |
precision=0,
|
| 128 |
info="Number of segments to consider for the language detection.")
|
| 129 |
with gr.Group(visible=isinstance(self.whisper_inf, InsanelyFastWhisperInference)):
|
| 130 |
-
nb_chunk_length_s = gr.Number(label="Chunk Lengths (sec)", value=whisper_params["chunk_length_s"],
|
| 131 |
-
precision=0)
|
| 132 |
nb_batch_size = gr.Number(label="Batch Size", value=whisper_params["batch_size"], precision=0)
|
| 133 |
|
| 134 |
with gr.Accordion("BGM Separation", open=False):
|
|
|
|
| 113 |
nb_max_new_tokens = gr.Number(label="Max New Tokens", value=lambda: whisper_params["max_new_tokens"],
|
| 114 |
precision=0,
|
| 115 |
info="Maximum number of new tokens to generate per-chunk. If not set, the maximum will be set by the default max_length.")
|
| 116 |
+
nb_chunk_length = gr.Number(label="Chunk Length (s)", value=lambda: whisper_params["chunk_length"],
|
| 117 |
precision=0,
|
| 118 |
info="The length of audio segments. If it is not None, it will overwrite the default chunk_length of the FeatureExtractor.")
|
| 119 |
nb_hallucination_silence_threshold = gr.Number(label="Hallucination Silence Threshold (sec)",
|
|
|
|
| 127 |
precision=0,
|
| 128 |
info="Number of segments to consider for the language detection.")
|
| 129 |
with gr.Group(visible=isinstance(self.whisper_inf, InsanelyFastWhisperInference)):
|
|
|
|
|
|
|
| 130 |
nb_batch_size = gr.Number(label="Batch Size", value=whisper_params["batch_size"], precision=0)
|
| 131 |
|
| 132 |
with gr.Accordion("BGM Separation", open=False):
|
configs/default_parameters.yaml
CHANGED
|
@@ -12,7 +12,7 @@ whisper:
|
|
| 12 |
initial_prompt: null
|
| 13 |
temperature: 0
|
| 14 |
compression_ratio_threshold: 2.4
|
| 15 |
-
|
| 16 |
batch_size: 24
|
| 17 |
length_penalty: 1
|
| 18 |
repetition_penalty: 1
|
|
@@ -25,7 +25,6 @@ whisper:
|
|
| 25 |
prepend_punctuations: "\"'“¿([{-"
|
| 26 |
append_punctuations: "\"'.。,,!!??::”)]}、"
|
| 27 |
max_new_tokens: null
|
| 28 |
-
chunk_length: null
|
| 29 |
hallucination_silence_threshold: null
|
| 30 |
hotwords: null
|
| 31 |
language_detection_threshold: null
|
|
|
|
| 12 |
initial_prompt: null
|
| 13 |
temperature: 0
|
| 14 |
compression_ratio_threshold: 2.4
|
| 15 |
+
chunk_length: 30
|
| 16 |
batch_size: 24
|
| 17 |
length_penalty: 1
|
| 18 |
repetition_penalty: 1
|
|
|
|
| 25 |
prepend_punctuations: "\"'“¿([{-"
|
| 26 |
append_punctuations: "\"'.。,,!!??::”)]}、"
|
| 27 |
max_new_tokens: null
|
|
|
|
| 28 |
hallucination_silence_threshold: null
|
| 29 |
hotwords: null
|
| 30 |
language_detection_threshold: null
|
modules/whisper/insanely_fast_whisper_inference.py
CHANGED
|
@@ -78,7 +78,7 @@ class InsanelyFastWhisperInference(WhisperBase):
|
|
| 78 |
segments = self.model(
|
| 79 |
inputs=audio,
|
| 80 |
return_timestamps=True,
|
| 81 |
-
chunk_length_s=params.
|
| 82 |
batch_size=params.batch_size,
|
| 83 |
generate_kwargs={
|
| 84 |
"language": params.lang,
|
|
|
|
| 78 |
segments = self.model(
|
| 79 |
inputs=audio,
|
| 80 |
return_timestamps=True,
|
| 81 |
+
chunk_length_s=params.chunk_length,
|
| 82 |
batch_size=params.batch_size,
|
| 83 |
generate_kwargs={
|
| 84 |
"language": params.lang,
|