Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,13 @@ import tempfile
|
|
7 |
import os
|
8 |
|
9 |
MODEL_NAME = "ylacombe/whisper-large-v3-turbo"
|
10 |
-
BATCH_SIZE =
|
11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
pipe = pipeline(
|
14 |
task="automatic-speech-recognition",
|
15 |
model=MODEL_NAME,
|
16 |
-
chunk_length_s=
|
17 |
device=device,
|
18 |
)
|
19 |
|
@@ -27,6 +27,6 @@ with gr.Blocks() as demo:
|
|
27 |
input_audio_microphone = gr.Audio(streaming=True)
|
28 |
output = gr.Textbox(label="Transcription", value="")
|
29 |
|
30 |
-
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output], time_limit=
|
31 |
|
32 |
demo.queue().launch()
|
|
|
7 |
import os
|
8 |
|
9 |
MODEL_NAME = "ylacombe/whisper-large-v3-turbo"
|
10 |
+
BATCH_SIZE = 8
|
11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
pipe = pipeline(
|
14 |
task="automatic-speech-recognition",
|
15 |
model=MODEL_NAME,
|
16 |
+
chunk_length_s=30,
|
17 |
device=device,
|
18 |
)
|
19 |
|
|
|
27 |
input_audio_microphone = gr.Audio(streaming=True)
|
28 |
output = gr.Textbox(label="Transcription", value="")
|
29 |
|
30 |
+
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output], time_limit=45, stream_every=2, concurrency_limit=None)
|
31 |
|
32 |
demo.queue().launch()
|