mhenrhcsen commited on
Commit
d8f994d
·
1 Parent(s): 0a493ad

Update app.py to enhance UI with new examples and localization, changing title and labels to Danish for improved user experience.

Browse files
Files changed (1) hide show
  1. app.py +13 -16
app.py CHANGED
@@ -149,8 +149,8 @@ def generate_speech(text, voice, temperature, top_p, repetition_penalty, max_new
149
 
150
  # Examples for the UI
151
  examples = [
152
- ["Hej mit navn er Mads. Jeg håber du har en god dag.", "mic", 0.6, 0.95, 1.1, 1200],
153
- ["Hej mit navn er Sofie. Jeg håber du har en god dag.", "nic", 0.6, 0.95, 1.1, 1200],
154
  ]
155
 
156
  # Available voices
@@ -160,27 +160,24 @@ VOICES = ["nic", "mic"]
160
  EMOTIVE_TAGS = []
161
 
162
  # Create Gradio interface
163
- with gr.Blocks(title="Orpheus Text-to-Speech") as demo:
164
  gr.Markdown(f"""
165
- # 🎵 [Orpheus Text-to-Speech](https://github.com/canopyai/Orpheus-TTS)
166
- Enter your text below and hear it converted to natural-sounding speech with the Orpheus TTS model.
167
 
168
- ## Tips for better prompts:
169
- - Add paralinguistic elements like {", ".join(EMOTIVE_TAGS)} or `uhm` for more human-like speech.
170
- - Longer text prompts generally work better than very short phrases
171
- - Increasing `repetition_penalty` and `temperature` makes the model speak faster.
172
  """)
173
  with gr.Row():
174
  with gr.Column(scale=3):
175
  text_input = gr.Textbox(
176
- label="Text to speak",
177
- placeholder="Enter your text here...",
178
  lines=5
179
  )
180
  voice = gr.Dropdown(
181
  choices=VOICES,
182
- value="tara",
183
- label="Voice"
184
  )
185
 
186
  with gr.Accordion("Advanced Settings", open=False):
@@ -206,11 +203,11 @@ with gr.Blocks(title="Orpheus Text-to-Speech") as demo:
206
  )
207
 
208
  with gr.Row():
209
- submit_btn = gr.Button("Generate Speech", variant="primary")
210
- clear_btn = gr.Button("Clear")
211
 
212
  with gr.Column(scale=2):
213
- audio_output = gr.Audio(label="Generated Speech", type="numpy")
214
 
215
  # Set up examples
216
  gr.Examples(
 
149
 
150
  # Examples for the UI
151
  examples = [
152
+ ["Spørger man Lykke Friis, der er tysklandskender og direktør i Tænketanken Europa, kan man kun gætte på årsagerne, men CDU-formanden er ikke gode venner med alle i koalitionsregeringen.", "mic", 0.2, 0.95, 1.1, 1200],
153
+ ["Det burde have været en formssag i Den Tyske Forbundsdag, men det endte som alt andet end det. For første gang i Forbundsrepublikkens historie fik kanslerkandidaten ikke nok stemmer til at sikre sig den fornemme titel som kansler, da der skulle stemmes i parlamentet.", "nic", 0.2, 0.95, 1.1, 2000],
154
  ]
155
 
156
  # Available voices
 
160
  EMOTIVE_TAGS = []
161
 
162
  # Create Gradio interface
163
+ with gr.Blocks(title="Syvai TTS v0.1") as demo:
164
  gr.Markdown(f"""
165
+ # 🎵 [Syvai TTS v0.1](https://huggingface.co/syvai/tts-v1-finetuned)
166
+ Skriv din tekst (gerne kortere end 200 tegn) nedenfor og hør hvad den kan.
167
 
168
+ Vi har pt. kun 2 stemmer, og ingen måde at styre tone, grin eller andre paralinguistiske elementer. Vi arbejder dog på at udgive en model med bedre stemmestying.
 
 
 
169
  """)
170
  with gr.Row():
171
  with gr.Column(scale=3):
172
  text_input = gr.Textbox(
173
+ label="Tekst at tale",
174
+ placeholder="Indtast din tekst her...",
175
  lines=5
176
  )
177
  voice = gr.Dropdown(
178
  choices=VOICES,
179
+ value="mic",
180
+ label="Stemme"
181
  )
182
 
183
  with gr.Accordion("Advanced Settings", open=False):
 
203
  )
204
 
205
  with gr.Row():
206
+ submit_btn = gr.Button("Generer tale", variant="primary")
207
+ clear_btn = gr.Button("Ryd")
208
 
209
  with gr.Column(scale=2):
210
+ audio_output = gr.Audio(label="Genereret tale", type="numpy")
211
 
212
  # Set up examples
213
  gr.Examples(