amir22010 commited on
Commit
826e641
·
verified ·
1 Parent(s): f968acd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -103,7 +103,7 @@ def greet(product,description):
103
  else:
104
  text_str = a_list[0]
105
  samples = tts.synthesize(text_str, speakers[-1])
106
- yield gr.Audio.update(value=(tts.get_sampling_rate(), samples))
107
  else:
108
  output = llm.create_chat_completion(
109
  messages=[
@@ -120,13 +120,12 @@ def greet(product,description):
120
  partial_message = ""
121
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
122
  speakers = tts.get_speakers()
123
- tts = TTS(os.path.join(os.getcwd(), tts_model_str))
124
  for chunk in output:
125
  delta = chunk['choices'][0]['delta']
126
  if 'content' in delta:
127
  samples = tts.synthesize(delta.get('content', ''), speakers[-1])
128
- yield gr.Audio.update(value=(tts.get_sampling_rate(), samples))
129
 
130
 
131
- demo = gr.Interface(fn=greet, inputs=["text","text"], outputs=gr.Audio(), concurrency_limit=10)
132
  demo.launch()
 
103
  else:
104
  text_str = a_list[0]
105
  samples = tts.synthesize(text_str, speakers[-1])
106
+ yield gr.Audio(value=(tts.get_sampling_rate(), samples))
107
  else:
108
  output = llm.create_chat_completion(
109
  messages=[
 
120
  partial_message = ""
121
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
122
  speakers = tts.get_speakers()
 
123
  for chunk in output:
124
  delta = chunk['choices'][0]['delta']
125
  if 'content' in delta:
126
  samples = tts.synthesize(delta.get('content', ''), speakers[-1])
127
+ yield gr.Audio(value=(tts.get_sampling_rate(), samples))
128
 
129
 
130
+ demo = gr.Interface(fn=greet, inputs=["text","text"], concurrency_limit=10)
131
  demo.launch()