Spaces:
Running
Running
Commit
·
ca631c5
1
Parent(s):
e8d8fb4
Update pages/best_model.py
Browse files- pages/best_model.py +2 -1
pages/best_model.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
from pythaitts import TTS
|
3 |
st.title("PyThaiTTS Demo - Best model")
|
4 |
tts = TTS(pretrained="khanomtan", mode="best_mode")
|
@@ -23,6 +24,6 @@ with form:
|
|
23 |
submitted = st.form_submit_button(label="Submit")
|
24 |
|
25 |
if submitted:
|
26 |
-
audio_file = tts.tts(text=str(text), speaker_idx=str(speaker_idx), language_idx=str(language))
|
27 |
audio_bytes = open(audio_file,"rb").read()
|
28 |
st.audio(audio_bytes, format='audio/wav')
|
|
|
1 |
import streamlit as st
|
2 |
+
from pythainlp.tokenize import word_tokenize
|
3 |
from pythaitts import TTS
|
4 |
st.title("PyThaiTTS Demo - Best model")
|
5 |
tts = TTS(pretrained="khanomtan", mode="best_mode")
|
|
|
24 |
submitted = st.form_submit_button(label="Submit")
|
25 |
|
26 |
if submitted:
|
27 |
+
audio_file = tts.tts(text=' '.join(word_tokenize(str(text))).replace(' ',' '), speaker_idx=str(speaker_idx), language_idx=str(language))
|
28 |
audio_bytes = open(audio_file,"rb").read()
|
29 |
st.audio(audio_bytes, format='audio/wav')
|