Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
22 |
|
23 |
|
24 |
def translate(audio):
|
25 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "
|
26 |
return outputs["text"]
|
27 |
|
28 |
|
@@ -49,13 +49,13 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
|
|
49 |
|
50 |
demo = gr.Blocks()
|
51 |
|
52 |
-
mic_translate = gr.Interface(
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
)
|
59 |
|
60 |
file_translate = gr.Interface(
|
61 |
fn=speech_to_speech_translation,
|
@@ -67,6 +67,6 @@ file_translate = gr.Interface(
|
|
67 |
)
|
68 |
|
69 |
with demo:
|
70 |
-
gr.TabbedInterface([
|
71 |
|
72 |
-
demo.launch(
|
|
|
22 |
|
23 |
|
24 |
def translate(audio):
|
25 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "pl"})
|
26 |
return outputs["text"]
|
27 |
|
28 |
|
|
|
49 |
|
50 |
demo = gr.Blocks()
|
51 |
|
52 |
+
# mic_translate = gr.Interface(
|
53 |
+
# fn=speech_to_speech_translation,
|
54 |
+
# inputs=gr.Audio(source="microphone", type="filepath"),
|
55 |
+
# outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
56 |
+
# title=title,
|
57 |
+
# description=description,
|
58 |
+
# )
|
59 |
|
60 |
file_translate = gr.Interface(
|
61 |
fn=speech_to_speech_translation,
|
|
|
67 |
)
|
68 |
|
69 |
with demo:
|
70 |
+
gr.TabbedInterface([file_translate], ["Audio File"])
|
71 |
|
72 |
+
demo.launch()
|