Spaces:
Sleeping
Sleeping
skriller18
commited on
Commit
ยท
7c4c876
1
Parent(s):
f1884d8
Dropdown Added
Browse files
app.py
CHANGED
@@ -3,10 +3,6 @@ import torchaudio
|
|
3 |
from transformers import pipeline
|
4 |
import streamlit as st
|
5 |
|
6 |
-
x = st.slider('Select a value')
|
7 |
-
st.write(x, 'squared is', x * x)
|
8 |
-
|
9 |
-
|
10 |
model_id = '11mlabs/indri-0.1-124m-tts'
|
11 |
task = 'indri-tts'
|
12 |
|
@@ -17,14 +13,33 @@ pipe = pipeline(
|
|
17 |
trust_remote_code=True
|
18 |
)
|
19 |
|
20 |
-
|
|
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
if st.button("Generate Audio"):
|
25 |
if text_input:
|
26 |
-
output = pipe([text_input], speaker=
|
27 |
torchaudio.save('output.wav', output[0]['audio'][0], sample_rate=24000)
|
28 |
-
st.audio('output.wav')
|
29 |
else:
|
30 |
st.warning("Please enter text to generate audio.")
|
|
|
3 |
from transformers import pipeline
|
4 |
import streamlit as st
|
5 |
|
|
|
|
|
|
|
|
|
6 |
model_id = '11mlabs/indri-0.1-124m-tts'
|
7 |
task = 'indri-tts'
|
8 |
|
|
|
13 |
trust_remote_code=True
|
14 |
)
|
15 |
|
16 |
+
st.title("Indri")
|
17 |
+
st.subheader("Ultrafast multi-modal AI")
|
18 |
|
19 |
+
speakers = {
|
20 |
+
"[spkr_63] : ๐ฌ๐ง ๐จ book reader",
|
21 |
+
"[spkr_67] : ๐บ๐ธ ๐จ influencer",
|
22 |
+
"[spkr_68] : ๐ฎ๐ณ ๐จ book reader",
|
23 |
+
"[spkr_69] : ๐ฎ๐ณ ๐จ book reader",
|
24 |
+
"[spkr_70] : ๐ฎ๐ณ ๐จ motivational speaker",
|
25 |
+
"[spkr_62] : ๐ฎ๐ณ ๐จ book reader heavy",
|
26 |
+
"[spkr_53] : ๐ฎ๐ณ ๐ฉ recipe reciter",
|
27 |
+
"[spkr_60] : ๐ฎ๐ณ ๐ฉ book reader",
|
28 |
+
"[spkr_74] : ๐บ๐ธ ๐จ book reader",
|
29 |
+
"[spkr_75] : ๐ฎ๐ณ ๐จ entrepreneur",
|
30 |
+
"[spkr_76] : ๐ฌ๐ง ๐จ nature lover",
|
31 |
+
"[spkr_77] : ๐ฎ๐ณ ๐จ influencer",
|
32 |
+
"[spkr_66] : ๐ฎ๐ณ ๐จ politician"
|
33 |
+
}
|
34 |
+
|
35 |
+
speaker_id = st.selectbox("Select a speaker:", options=list(speakers.keys()), format_func=lambda x: speakers[x])
|
36 |
+
|
37 |
+
text_input = st.text_area("Enter text for TTS (max 200 characters):", max_chars=200)
|
38 |
|
39 |
if st.button("Generate Audio"):
|
40 |
if text_input:
|
41 |
+
output = pipe([text_input], speaker=speaker_id)
|
42 |
torchaudio.save('output.wav', output[0]['audio'][0], sample_rate=24000)
|
43 |
+
st.audio('output.wav')
|
44 |
else:
|
45 |
st.warning("Please enter text to generate audio.")
|