skriller18 commited on
Commit
7c4c876
ยท
1 Parent(s): f1884d8

Dropdown Added

Browse files
Files changed (1) hide show
  1. app.py +23 -8
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
- text_input = st.text_area("Enter text for TTS (max 200 characters):", max_chars=200)
 
21
 
22
- speaker_name = st.text_input("Enter speaker's name:")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  if st.button("Generate Audio"):
25
  if text_input:
26
- output = pipe([text_input], speaker=speaker_name)
27
  torchaudio.save('output.wav', output[0]['audio'][0], sample_rate=24000)
28
- st.audio('output.wav') # Display audio blob output
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.")