TDN-M commited on
Commit
53bf813
·
verified ·
1 Parent(s): 81a9b63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -134,12 +134,12 @@ def interface():
134
  inputs=[prompt, file_upload, content_type],
135
  outputs=[content_output, download_docx, status_message])
136
 
137
- confirm_button.click(lambda x: asyncio.run(confirm_content(x)),
138
  inputs=[content_output],
139
  outputs=[download_docx, download_audio, status_message])
140
 
141
  # Định nghĩa danh sách giọng đọc
142
- VOICES = ["vi-VN-HoaiMyNeural"]
143
 
144
  with gr.Tab("Tạo Âm thanh"):
145
  text_input = gr.Textbox(label="Nhập văn bản để chuyển đổi")
@@ -148,7 +148,7 @@ def interface():
148
  audio_output = gr.Audio(label="Âm thanh tạo ra")
149
  download_audio = gr.File(label="Tải xuống file âm thanh", interactive=False)
150
 
151
- def text_to_speech_func(text, voice):
152
  try:
153
  audio_path = await async_text_to_speech(text, voice, "Tiếng Việt")
154
  return audio_path, audio_path
@@ -221,4 +221,4 @@ def interface():
221
  # Khởi chạy ứng dụng
222
  if __name__ == "__main__":
223
  app = interface()
224
- app.launch(share=True)
 
134
  inputs=[prompt, file_upload, content_type],
135
  outputs=[content_output, download_docx, status_message])
136
 
137
+ confirm_button.click(confirm_content,
138
  inputs=[content_output],
139
  outputs=[download_docx, download_audio, status_message])
140
 
141
  # Định nghĩa danh sách giọng đọc
142
+ VOICES = ["alloy", "echo", "fable", "onyx", "nova", "shimmer"]
143
 
144
  with gr.Tab("Tạo Âm thanh"):
145
  text_input = gr.Textbox(label="Nhập văn bản để chuyển đổi")
 
148
  audio_output = gr.Audio(label="Âm thanh tạo ra")
149
  download_audio = gr.File(label="Tải xuống file âm thanh", interactive=False)
150
 
151
+ async def text_to_speech_func(text, voice):
152
  try:
153
  audio_path = await async_text_to_speech(text, voice, "Tiếng Việt")
154
  return audio_path, audio_path
 
221
  # Khởi chạy ứng dụng
222
  if __name__ == "__main__":
223
  app = interface()
224
+ app.launch(share=True)