JackismyShephard commited on
Commit
1aa084a
·
1 Parent(s): eb8128e

cache examples and change labels

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -14,6 +14,7 @@ asr_pipe = pipeline(
14
  "automatic-speech-recognition",
15
  model="openai/whisper-base",
16
  device=device,
 
17
  use_fast=True,
18
  )
19
 
@@ -39,7 +40,6 @@ def translate(audio):
39
  audio,
40
  max_new_tokens=256,
41
  batch_size=8,
42
- chunk_length_s=30,
43
  generate_kwargs={"task": "translate", "language": "danish"},
44
  )
45
  return outputs["text"]
@@ -105,11 +105,15 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
105
 
106
  demo = gr.Interface(
107
  fn=speech_to_speech_translation,
108
- inputs=gr.Audio(type="filepath"),
109
- outputs=gr.Audio(label="Generated Speech", type="numpy"),
110
- examples=[["./example.wav"]],
 
111
  title=title,
112
  description=description,
 
 
 
113
  )
114
 
115
  demo.launch()
 
14
  "automatic-speech-recognition",
15
  model="openai/whisper-base",
16
  device=device,
17
+ chunk_length_s=30,
18
  use_fast=True,
19
  )
20
 
 
40
  audio,
41
  max_new_tokens=256,
42
  batch_size=8,
 
43
  generate_kwargs={"task": "translate", "language": "danish"},
44
  )
45
  return outputs["text"]
 
105
 
106
  demo = gr.Interface(
107
  fn=speech_to_speech_translation,
108
+ inputs=[
109
+ gr.Audio(label="Input Speech", type="filepath"),
110
+ ],
111
+ outputs=gr.Audio(label="Translated Speech", type="numpy"),
112
  title=title,
113
  description=description,
114
+ examples=[["./example.wav"]],
115
+ cache_examples=True,
116
+ allow_flagging="never",
117
  )
118
 
119
  demo.launch()