amir22010 commited on
Commit
c3da1b1
·
verified ·
1 Parent(s): 936ad1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -102,7 +102,10 @@ async def greet(product,description):
102
  if tts is not None:
103
  del tts
104
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
105
- samples = tts.synthesize(a_list[0], "92")
 
 
 
106
  yield (tts.get_sampling_rate(), samples)
107
  else:
108
  output = llm.create_chat_completion(
@@ -125,7 +128,10 @@ async def greet(product,description):
125
  if tts is not None:
126
  del tts
127
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
128
- samples = tts.synthesize(delta.get('content', ''), "92")
 
 
 
129
  yield (tts.get_sampling_rate(), samples)
130
 
131
  demo = gr.Interface(fn=greet, inputs=["text","text"], outputs=gr.Audio(), concurrency_limit=10)
 
102
  if tts is not None:
103
  del tts
104
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
105
+ speakers = tts.get_speakers()
106
+ model_to_speakers = dict()
107
+ model_to_speakers[tts_model_str] = speakers
108
+ samples = tts.synthesize(a_list[0], speakers[-1])
109
  yield (tts.get_sampling_rate(), samples)
110
  else:
111
  output = llm.create_chat_completion(
 
128
  if tts is not None:
129
  del tts
130
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
131
+ speakers = tts.get_speakers()
132
+ model_to_speakers = dict()
133
+ model_to_speakers[tts_model_str] = speakers
134
+ samples = tts.synthesize(delta.get('content', ''), speakers[-1])
135
  yield (tts.get_sampling_rate(), samples)
136
 
137
  demo = gr.Interface(fn=greet, inputs=["text","text"], outputs=gr.Audio(), concurrency_limit=10)