jonathanagustin commited on
Commit
a8cd62f
1 Parent(s): 1a29ae8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -97,10 +97,14 @@ def main():
97
  placeholder="Enter your OpenAI API Key",
98
  )
99
  model_dropdown = gr.Dropdown(
100
- choices=MODEL_OPTIONS, label="Model", value="tts-1"
 
 
101
  )
102
  voice_dropdown = gr.Dropdown(
103
- choices=VOICE_OPTIONS, label="Voice Options", value="echo"
 
 
104
  )
105
 
106
  # Wrap the voice previews inside an Accordion that is closed by default
@@ -113,7 +117,9 @@ def main():
113
  for voice in VOICE_OPTIONS:
114
  # Create a button for each voice
115
  voice_button = gr.Button(
116
- value=f"▶ {voice.capitalize()}", variant="secondary"
 
 
117
  )
118
 
119
  # Define the handler function for this voice using partial
@@ -127,10 +133,13 @@ def main():
127
 
128
  with gr.Column(scale=2):
129
  input_textbox = gr.Textbox(
130
- label="Input Text", lines=10, placeholder="Type your text here..."
 
 
131
  )
132
  submit_button = gr.Button(
133
- "Convert Text to Speech", variant="primary"
 
134
  )
135
  with gr.Column(scale=1):
136
  output_audio = gr.Audio(label="Output Audio")
@@ -152,4 +161,4 @@ def main():
152
 
153
 
154
  if __name__ == "__main__":
155
- main()
 
97
  placeholder="Enter your OpenAI API Key",
98
  )
99
  model_dropdown = gr.Dropdown(
100
+ choices=MODEL_OPTIONS,
101
+ label="Model",
102
+ value="tts-1",
103
  )
104
  voice_dropdown = gr.Dropdown(
105
+ choices=VOICE_OPTIONS,
106
+ label="Voice Options",
107
+ value="echo",
108
  )
109
 
110
  # Wrap the voice previews inside an Accordion that is closed by default
 
117
  for voice in VOICE_OPTIONS:
118
  # Create a button for each voice
119
  voice_button = gr.Button(
120
+ value=f"▶ {voice.capitalize()}",
121
+ variant="secondary",
122
+ size="sm",
123
  )
124
 
125
  # Define the handler function for this voice using partial
 
133
 
134
  with gr.Column(scale=2):
135
  input_textbox = gr.Textbox(
136
+ label="Input Text",
137
+ lines=10,
138
+ placeholder="Type your text here...",
139
  )
140
  submit_button = gr.Button(
141
+ "Convert Text to Speech",
142
+ variant="primary",
143
  )
144
  with gr.Column(scale=1):
145
  output_audio = gr.Audio(label="Output Audio")
 
161
 
162
 
163
  if __name__ == "__main__":
164
+ main()