Spaces:
Running
Running
jhj0517
commited on
Commit
·
ca26f25
1
Parent(s):
5206df6
add `initial_prompt`
Browse files
modules/whisper_data_class.py
CHANGED
|
@@ -15,6 +15,7 @@ class WhisperGradioComponents:
|
|
| 15 |
best_of: gr.Number
|
| 16 |
patience: gr.Number
|
| 17 |
condition_on_previous_text: gr.Checkbox
|
|
|
|
| 18 |
"""
|
| 19 |
A data class to pass Gradio components to the function before Gradio pre-processing.
|
| 20 |
See this documentation for more information about Gradio pre-processing: https://www.gradio.app/docs/components
|
|
@@ -52,10 +53,15 @@ class WhisperGradioComponents:
|
|
| 52 |
patience: gr.Number
|
| 53 |
Beam search patience factor.
|
| 54 |
|
| 55 |
-
condition_on_previous_text:
|
| 56 |
if True, the previous output of the model is provided as a prompt for the next window;
|
| 57 |
disabling may make the text inconsistent across windows, but the model becomes less prone to
|
| 58 |
getting stuck in a failure loop, such as repetition looping or timestamps going out of sync.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
"""
|
| 60 |
|
| 61 |
def to_list(self) -> list:
|
|
@@ -82,6 +88,7 @@ class WhisperValues:
|
|
| 82 |
best_of: int
|
| 83 |
patience: float
|
| 84 |
condition_on_previous_text: bool
|
|
|
|
| 85 |
"""
|
| 86 |
A data class to use Whisper parameters in your function after Gradio pre-processing.
|
| 87 |
See this documentation for more information about Gradio pre-processing: : https://www.gradio.app/docs/components
|
|
|
|
| 15 |
best_of: gr.Number
|
| 16 |
patience: gr.Number
|
| 17 |
condition_on_previous_text: gr.Checkbox
|
| 18 |
+
initial_prompt: gr.Textbox
|
| 19 |
"""
|
| 20 |
A data class to pass Gradio components to the function before Gradio pre-processing.
|
| 21 |
See this documentation for more information about Gradio pre-processing: https://www.gradio.app/docs/components
|
|
|
|
| 53 |
patience: gr.Number
|
| 54 |
Beam search patience factor.
|
| 55 |
|
| 56 |
+
condition_on_previous_text: gr.Checkbox
|
| 57 |
if True, the previous output of the model is provided as a prompt for the next window;
|
| 58 |
disabling may make the text inconsistent across windows, but the model becomes less prone to
|
| 59 |
getting stuck in a failure loop, such as repetition looping or timestamps going out of sync.
|
| 60 |
+
|
| 61 |
+
initial_prompt: gr.Textbox
|
| 62 |
+
Optional text to provide as a prompt for the first window. This can be used to provide, or
|
| 63 |
+
"prompt-engineer" a context for transcription, e.g. custom vocabularies or proper nouns
|
| 64 |
+
to make it more likely to predict those word correctly.
|
| 65 |
"""
|
| 66 |
|
| 67 |
def to_list(self) -> list:
|
|
|
|
| 88 |
best_of: int
|
| 89 |
patience: float
|
| 90 |
condition_on_previous_text: bool
|
| 91 |
+
initial_prompt: Optional[str]
|
| 92 |
"""
|
| 93 |
A data class to use Whisper parameters in your function after Gradio pre-processing.
|
| 94 |
See this documentation for more information about Gradio pre-processing: : https://www.gradio.app/docs/components
|