Nuno-Tome commited on
Commit
f16f614
·
1 Parent(s): 339629e

no message

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -19,7 +19,7 @@ def get_speech(text, voice):
19
  '''
20
  client = Client("https://collabora-whisperspeech.hf.space/")
21
  result = client.predict(
22
- # str in 'Enter multilingual text📝💬' Textbox component
23
  text,
24
  # filepath in 'Upload or Record Speaker Audio (optional)🌬️💬' Audio component
25
  voice,
@@ -45,3 +45,24 @@ def generate_audio(pipe, segments, speaker, speaker_url, cps=14):
45
  audio = pipe.vocoder.decode(atoks)
46
  return audio.cpu()
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  '''
20
  client = Client("https://collabora-whisperspeech.hf.space/")
21
  result = client.predict(
22
+ # str in 'Enter multilingual text📝' Textbox component
23
  text,
24
  # filepath in 'Upload or Record Speaker Audio (optional)🌬️💬' Audio component
25
  voice,
 
45
  audio = pipe.vocoder.decode(atoks)
46
  return audio.cpu()
47
 
48
+
49
+
50
+ with gr.Blocks() as demo:
51
+ with gr.Row():
52
+ text_input = gr.Textbox(label="Enter multilingual text📝")
53
+ cps = gr.Slider(value=14, minimum=10, maximum=15, step=.25,
54
+ label="Speed (in characters per second)")
55
+
56
+ with gr.Row(equal_height=True):
57
+ speaker_input = gr.Audio(label="Upload or Record Speaker Audio (optional)🌬️💬",
58
+ sources=["upload", "microphone"],
59
+ type='filepath')
60
+ url_input = gr.Textbox(label="alternatively, you can paste in an audio file URL:")
61
+ gr.Markdown(" \n ") # fixes the bottom overflow from Audio
62
+ generate_button = gr.Button("Try Collabora's WhisperSpeech🌟")
63
+ with gr.Column(scale=1):
64
+ output_audio = gr.Audio(label="WhisperSpeech says…")
65
+
66
+
67
+
68
+ demo.launch(server_port=46007)