KingNish commited on
Commit
a6e64af
1 Parent(s): 4c0f222

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
app.py CHANGED
@@ -104,32 +104,32 @@ with gr.Blocks() as file:
104
  submit_button.click(transcribe, [input_audio_microphone, output], [output, latency_textbox], concurrency_limit=None)
105
  clear_button.click(clear, outputs=[output])
106
 
107
- with gr.Blocks() as translate:
108
- with gr.Column():
109
- gr.Markdown(f"# Realtime Whisper Large V3 Turbo (Translation): \n Transcribe and Translate Audio in Realtime. This Demo uses the Checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers.\n Note: The first token takes about 5 seconds. After that, it works flawlessly.")
110
- with gr.Row():
111
- input_audio_microphone = gr.Audio(streaming=True)
112
- output = gr.Textbox(label="Transcription and Translation", value="")
113
- latency_textbox = gr.Textbox(label="Latency (seconds)", value="0.0", scale=0)
114
- target_language_dropdown = gr.Dropdown(
115
- choices=["english", "french", "hindi", "spanish", "russian"],
116
- label="Target Language",
117
- value="<|es|>"
118
- )
119
- with gr.Row():
120
- clear_button = gr.Button("Clear Output")
121
-
122
- input_audio_microphone.stream(
123
- translate_and_transcribe,
124
- [input_audio_microphone, output, target_language_dropdown],
125
- [output, latency_textbox],
126
- time_limit=45,
127
- stream_every=2,
128
- concurrency_limit=None
129
- )
130
- clear_button.click(clear, outputs=[output])
131
 
132
  with gr.Blocks() as demo:
133
- gr.TabbedInterface([microphone, translate, file], ["Microphone", "Realtime Translation", "Transcribe from file"])
134
 
135
  demo.launch()
 
104
  submit_button.click(transcribe, [input_audio_microphone, output], [output, latency_textbox], concurrency_limit=None)
105
  clear_button.click(clear, outputs=[output])
106
 
107
+ # with gr.Blocks() as translate:
108
+ # with gr.Column():
109
+ # gr.Markdown(f"# Realtime Whisper Large V3 Turbo (Translation): \n Transcribe and Translate Audio in Realtime. This Demo uses the Checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers.\n Note: The first token takes about 5 seconds. After that, it works flawlessly.")
110
+ # with gr.Row():
111
+ # input_audio_microphone = gr.Audio(streaming=True)
112
+ # output = gr.Textbox(label="Transcription and Translation", value="")
113
+ # latency_textbox = gr.Textbox(label="Latency (seconds)", value="0.0", scale=0)
114
+ # target_language_dropdown = gr.Dropdown(
115
+ # choices=["english", "french", "hindi", "spanish", "russian"],
116
+ # label="Target Language",
117
+ # value="<|es|>"
118
+ # )
119
+ # with gr.Row():
120
+ # clear_button = gr.Button("Clear Output")
121
+
122
+ # input_audio_microphone.stream(
123
+ # translate_and_transcribe,
124
+ # [input_audio_microphone, output, target_language_dropdown],
125
+ # [output, latency_textbox],
126
+ # time_limit=45,
127
+ # stream_every=2,
128
+ # concurrency_limit=None
129
+ # )
130
+ # clear_button.click(clear, outputs=[output])
131
 
132
  with gr.Blocks() as demo:
133
+ gr.TabbedInterface([microphone, file], ["Microphone", "Transcribe from file"])
134
 
135
  demo.launch()