daavoo commited on
Commit
0c2ec7e
1 Parent(s): 85f1ae3

Update app

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -8,11 +8,11 @@ import streamlit as st
8
  from document_to_podcast.preprocessing import DATA_LOADERS, DATA_CLEANERS
9
  from document_to_podcast.inference.model_loaders import (
10
  load_llama_cpp_model,
11
- load_tts_model,
12
  )
13
  from document_to_podcast.config import DEFAULT_PROMPT, DEFAULT_SPEAKERS, Speaker
14
- from document_to_podcast.inference.text_to_text import text_to_text_stream
15
  from document_to_podcast.inference.text_to_speech import text_to_speech
 
16
 
17
 
18
  @st.cache_resource
@@ -24,7 +24,7 @@ def load_text_to_text_model():
24
 
25
  @st.cache_resource
26
  def load_text_to_speech_model():
27
- return load_tts_model("OuteAI/OuteTTS-0.2-500M-GGUF/OuteTTS-0.2-500M-FP16.gguf")
28
 
29
 
30
  script = "script"
@@ -150,10 +150,10 @@ if uploaded_file is not None:
150
  with st.spinner("Generating Audio..."):
151
  speech = text_to_speech(
152
  text.split(f'"Speaker {speaker_id}":')[-1],
153
- model=speech_model,
154
- voice_profile=voice_profile,
155
  )
156
- st.audio(speech, sample_rate=speech_model.sample_rate)
157
 
158
  st.session_state.audio.append(speech)
159
  text = ""
@@ -164,7 +164,7 @@ if uploaded_file is not None:
164
  sf.write(
165
  "podcast.wav",
166
  st.session_state.audio,
167
- samplerate=speech_model.sample_rate,
168
  )
169
  st.markdown("Podcast saved to disk!")
170
 
 
8
  from document_to_podcast.preprocessing import DATA_LOADERS, DATA_CLEANERS
9
  from document_to_podcast.inference.model_loaders import (
10
  load_llama_cpp_model,
11
+ load_outetts_model,
12
  )
13
  from document_to_podcast.config import DEFAULT_PROMPT, DEFAULT_SPEAKERS, Speaker
 
14
  from document_to_podcast.inference.text_to_speech import text_to_speech
15
+ from document_to_podcast.inference.text_to_text import text_to_text_stream
16
 
17
 
18
  @st.cache_resource
 
24
 
25
  @st.cache_resource
26
  def load_text_to_speech_model():
27
+ return load_outetts_model("OuteAI/OuteTTS-0.2-500M-GGUF/OuteTTS-0.2-500M-FP16.gguf")
28
 
29
 
30
  script = "script"
 
150
  with st.spinner("Generating Audio..."):
151
  speech = text_to_speech(
152
  text.split(f'"Speaker {speaker_id}":')[-1],
153
+ speech_model,
154
+ voice_profile,
155
  )
156
+ st.audio(speech, sample_rate=speech_model.audio_codec.sr)
157
 
158
  st.session_state.audio.append(speech)
159
  text = ""
 
164
  sf.write(
165
  "podcast.wav",
166
  st.session_state.audio,
167
+ samplerate=speech_model.audio_codec.sr,
168
  )
169
  st.markdown("Podcast saved to disk!")
170