Matthijs Hollemans commited on
Commit
2b82728
β€’
1 Parent(s): 24c15f3

fix issue with examples

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -36,7 +36,7 @@ def process_audio(sampling_rate, waveform):
36
  return waveform
37
 
38
 
39
- def predict(audio, mic_audio, speaker):
40
  # audio = tuple (sample_rate, frames) or (sample_rate, (frames, channels))
41
  if mic_audio is not None:
42
  sampling_rate, waveform = mic_audio
@@ -107,18 +107,18 @@ article = """
107
  """
108
 
109
  examples = [
110
- ["examples/yearn_for_time.mp3", None, "BDL (male)"],
111
- ["examples/henry5.mp3", None, "CLB (female)"],
112
- ["examples/see_in_eyes.wav", None, "RMS (male)"],
113
- ["examples/hmm_i_dont_know.wav", None, "SLT (female)"],
114
  ]
115
 
116
  gr.Interface(
117
  fn=predict,
118
  inputs=[
 
119
  gr.Audio(label="Upload Speech", source="upload", type="numpy"),
120
  gr.Audio(label="Record Speech", source="microphone", type="numpy"),
121
- gr.Radio(label="Speaker", choices=["BDL (male)", "CLB (female)", "RMS (male)", "SLT (female)"], value="BDL (male)"),
122
  ],
123
  outputs=[
124
  gr.Audio(label="Converted Speech", type="numpy"),
@@ -127,4 +127,5 @@ gr.Interface(
127
  description=description,
128
  article=article,
129
  examples=examples,
 
130
  ).launch()
 
36
  return waveform
37
 
38
 
39
+ def predict(speaker, audio, mic_audio=None):
40
  # audio = tuple (sample_rate, frames) or (sample_rate, (frames, channels))
41
  if mic_audio is not None:
42
  sampling_rate, waveform = mic_audio
 
107
  """
108
 
109
  examples = [
110
+ ["BDL (male)", "examples/yearn_for_time.mp3", None],
111
+ ["CLB (female)", "examples/henry5.mp3", None],
112
+ ["RMS (male)", "examples/see_in_eyes.wav", None],
113
+ ["SLT (female)", "examples/hmm_i_dont_know.wav", None],
114
  ]
115
 
116
  gr.Interface(
117
  fn=predict,
118
  inputs=[
119
+ gr.Radio(label="Speaker", choices=["BDL (male)", "CLB (female)", "RMS (male)", "SLT (female)"], value="BDL (male)"),
120
  gr.Audio(label="Upload Speech", source="upload", type="numpy"),
121
  gr.Audio(label="Record Speech", source="microphone", type="numpy"),
 
122
  ],
123
  outputs=[
124
  gr.Audio(label="Converted Speech", type="numpy"),
 
127
  description=description,
128
  article=article,
129
  examples=examples,
130
+ #cache_examples=True,
131
  ).launch()