gorkemgoknar commited on
Commit
fc0da9c
1 Parent(s): 97c71c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -103,7 +103,7 @@ MODEL_NAME= "tts_models/multilingual/multi-dataset/your_tts"
103
 
104
 
105
 
106
- def greet(character,audio,message,history,voice):
107
 
108
  #gradios set_state/get_state had problems on embedded html!
109
  history = history or {"character": character, "message_history" : [] }
@@ -116,7 +116,7 @@ def greet(character,audio,message,history,voice):
116
 
117
 
118
  response = get_chat_response(character,history=history["message_history"],input_txt=message)
119
- os.system('tts --text "'+response+'" --model_name tts_models/multilingual/multi-dataset/your_tts --speaker_wav '+audio+' --language_idx "es"')
120
  voice = "tts_output.wav"
121
 
122
  history["message_history"].append((message, response))
@@ -158,8 +158,7 @@ examples=[['Gandalf','Hello','test.wav']]
158
  history = {"character": "None", "message_history" : [] }
159
  interface= gr.Interface(fn=greet,
160
  inputs=[gr.inputs.Dropdown(personality_choices),gr.inputs.Audio(source="microphone", type="filepath") ,"text", "state"],
161
- outputs=["html","state"],
162
-
163
  css=css, title=title, description=description,article=article )
164
 
165
 
 
103
 
104
 
105
 
106
+ def greet(character,audio,message,history):
107
 
108
  #gradios set_state/get_state had problems on embedded html!
109
  history = history or {"character": character, "message_history" : [] }
 
116
 
117
 
118
  response = get_chat_response(character,history=history["message_history"],input_txt=message)
119
+ os.system('tts --text "'+response+'" --model_name tts_models/multilingual/multi-dataset/your_tts --speaker_wav '+audio+' --language_idx "en"')
120
  voice = "tts_output.wav"
121
 
122
  history["message_history"].append((message, response))
 
158
  history = {"character": "None", "message_history" : [] }
159
  interface= gr.Interface(fn=greet,
160
  inputs=[gr.inputs.Dropdown(personality_choices),gr.inputs.Audio(source="microphone", type="filepath") ,"text", "state"],
161
+ outputs=["html","state",gr.Audio(type="filepath")],
 
162
  css=css, title=title, description=description,article=article )
163
 
164