Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ asr_pipe_whisper = pipeline(task="automatic-speech-recognition", model="openai/w
|
|
13 |
def transcribeFile(inputlang, audio_path : str) -> str:
|
14 |
#transcription = asr_pipe_audio2Text_Ge(audio_path)
|
15 |
#transcription = asr_pipe_whisper(audio_path, max_new_tokens=256, generate_kwargs={"task":"transcribe"})
|
16 |
-
if inputlang == "
|
17 |
transcription = asr_pipe_whisper(audio_path, chunk_length_s=25, stride_length_s=(5, 0), generate_kwargs={"task":"transcribe"})
|
18 |
elif inputlang == "German":
|
19 |
transcription = asr_pipe_audio2Text_Ge(audio_path, chunk_length_s=25, stride_length_s=(5, 0))
|
@@ -39,7 +39,7 @@ def transcribeFileMulti(inputlang, audio_path : str) -> str:
|
|
39 |
app1 = gr.Interface(
|
40 |
fn=transcribeFile,
|
41 |
#inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
|
42 |
-
inputs=[gr.Radio(["
|
43 |
gr.Audio(source="upload", type="filepath",label="Upload audio file")],
|
44 |
outputs="text",
|
45 |
title=title
|
@@ -48,7 +48,7 @@ app1 = gr.Interface(
|
|
48 |
|
49 |
app2 = gr.Interface(
|
50 |
fn=transcribeFileMulti,
|
51 |
-
inputs=[gr.Radio(["
|
52 |
gr.Audio(source="microphone", type="filepath")],
|
53 |
outputs="text",
|
54 |
title=title
|
|
|
13 |
def transcribeFile(inputlang, audio_path : str) -> str:
|
14 |
#transcription = asr_pipe_audio2Text_Ge(audio_path)
|
15 |
#transcription = asr_pipe_whisper(audio_path, max_new_tokens=256, generate_kwargs={"task":"transcribe"})
|
16 |
+
if inputlang == "Auto Detect":
|
17 |
transcription = asr_pipe_whisper(audio_path, chunk_length_s=25, stride_length_s=(5, 0), generate_kwargs={"task":"transcribe"})
|
18 |
elif inputlang == "German":
|
19 |
transcription = asr_pipe_audio2Text_Ge(audio_path, chunk_length_s=25, stride_length_s=(5, 0))
|
|
|
39 |
app1 = gr.Interface(
|
40 |
fn=transcribeFile,
|
41 |
#inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
|
42 |
+
inputs=[gr.Radio(["Auto Detect", "German"], value="Auto Detect", label="Source Language", info="Select the language of the speech you want to transcribe"),
|
43 |
gr.Audio(source="upload", type="filepath",label="Upload audio file")],
|
44 |
outputs="text",
|
45 |
title=title
|
|
|
48 |
|
49 |
app2 = gr.Interface(
|
50 |
fn=transcribeFileMulti,
|
51 |
+
inputs=[gr.Radio(["Auto Detect", "German"], value="Auto Detect", label="Source Language", info="Select the language of the speech you want to transcribe"),
|
52 |
gr.Audio(source="microphone", type="filepath")],
|
53 |
outputs="text",
|
54 |
title=title
|