Ionut-Bostan commited on
Commit
e0e4c11
1 Parent(s): 0dc9f9f

update app

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -7,8 +7,7 @@ predefined_texts = [
7
  "Hardly were our plans made public before we were met by powerful opposition.",
8
  ]
9
 
10
- emotion_mapping = {"amused": 0, "anger": 1,
11
- "disgust": 2, "neutral": 3, "sleepiness": 4}
12
 
13
  def synthesize_speech(input_type, text, own_text, speaker_id, embed_type, emotion_id):
14
  if input_type == "Choose from examples":
@@ -29,7 +28,7 @@ input_type = gr.Radio(
29
  choices=["Choose from examples", "Enter your own text"], label="Input Type")
30
  text = gr.Dropdown(choices=predefined_texts, label="Select a text")
31
  own_text = gr.Textbox(lines=2, label="Enter your own text")
32
- speaker_id = gr.Slider(minimum=0, maximum=3, step=1, default=0, label="Speaker ID")
33
  embed_type = gr.Radio(choices=["bert_embed", "emotion_id"], label="Embedding Type")
34
  emotion_id = gr.Dropdown(choices=list(emotion_mapping.keys()), label="Select Emotion")
35
 
 
7
  "Hardly were our plans made public before we were met by powerful opposition.",
8
  ]
9
 
10
+ emotion_mapping = {"amused": 0, "anger": 1, "disgust": 2, "neutral": 3, "sleepiness": 4}
 
11
 
12
  def synthesize_speech(input_type, text, own_text, speaker_id, embed_type, emotion_id):
13
  if input_type == "Choose from examples":
 
28
  choices=["Choose from examples", "Enter your own text"], label="Input Type")
29
  text = gr.Dropdown(choices=predefined_texts, label="Select a text")
30
  own_text = gr.Textbox(lines=2, label="Enter your own text")
31
+ speaker_id = gr.Slider(minimum=0, maximum=3, step=1, value=0, label="Speaker ID") # Updated from `default` to `value`
32
  embed_type = gr.Radio(choices=["bert_embed", "emotion_id"], label="Embedding Type")
33
  emotion_id = gr.Dropdown(choices=list(emotion_mapping.keys()), label="Select Emotion")
34