Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,15 +19,15 @@ pipe = pipeline(
|
|
| 19 |
|
| 20 |
@spaces.GPU
|
| 21 |
def transcribe(inputs, previous_transcription):
|
| 22 |
-
text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=True)["text"]
|
| 23 |
if previous_transcription:
|
| 24 |
text = previous_transcription + text
|
| 25 |
return text
|
| 26 |
|
| 27 |
with gr.Blocks() as demo:
|
| 28 |
with gr.Column():
|
| 29 |
-
input_audio_microphone = gr.Audio(streaming=True
|
| 30 |
-
output = gr.Textbox("Transcription")
|
| 31 |
|
| 32 |
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output], time_limit=15, stream_every=1, concurrency_limit=None)
|
| 33 |
|
|
|
|
| 19 |
|
| 20 |
@spaces.GPU
|
| 21 |
def transcribe(inputs, previous_transcription):
|
| 22 |
+
text = pipe(inputs[1], batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=True)["text"]
|
| 23 |
if previous_transcription:
|
| 24 |
text = previous_transcription + text
|
| 25 |
return text
|
| 26 |
|
| 27 |
with gr.Blocks() as demo:
|
| 28 |
with gr.Column():
|
| 29 |
+
input_audio_microphone = gr.Audio(streaming=True)
|
| 30 |
+
output = gr.Textbox(label"Transcription")
|
| 31 |
|
| 32 |
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output], time_limit=15, stream_every=1, concurrency_limit=None)
|
| 33 |
|