amir22010 commited on
Commit
b96fdc3
·
verified ·
1 Parent(s): d85b3ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -107,7 +107,7 @@ def greet(product,description):
107
  else:
108
  text_str = a_list[0]
109
  samples = tts.synthesize(text_str, speakers[-1])
110
- yield gr.Audio(value=(tts.get_sampling_rate(), samples))
111
  else:
112
  output = llm.create_chat_completion(
113
  messages=[
@@ -129,8 +129,9 @@ def greet(product,description):
129
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
130
  speakers = tts.get_speakers()
131
  samples = tts.synthesize(delta.get('content', ''), speakers[-1])
132
- yield gr.Audio(value=(tts.get_sampling_rate(), samples))
 
133
 
134
  audio = gr.Audio()
135
- demo = gr.Interface(fn=greet, inputs=["text","text"], concurrency_limit=10, outputs=audio)
136
  demo.launch()
 
107
  else:
108
  text_str = a_list[0]
109
  samples = tts.synthesize(text_str, speakers[-1])
110
+ yield gr.Audio(value=(tts.get_sampling_rate(), samples)), text_str
111
  else:
112
  output = llm.create_chat_completion(
113
  messages=[
 
129
  tts = TTS(os.path.join(os.getcwd(), tts_model_str))
130
  speakers = tts.get_speakers()
131
  samples = tts.synthesize(delta.get('content', ''), speakers[-1])
132
+ partial_message = partial_message + delta.get('content', '')
133
+ yield gr.Audio(value=(tts.get_sampling_rate(), samples)), partial_message
134
 
135
  audio = gr.Audio()
136
+ demo = gr.Interface(fn=greet, inputs=["text","text"], concurrency_limit=10, outputs=[audio,"text"])
137
  demo.launch()