Spaces:
Runtime error
Runtime error
github-actions[bot]
commited on
Commit
·
9ae4486
1
Parent(s):
6b39985
Sync with https://github.com/mozilla-ai/document-to-podcast
Browse files
app.py
CHANGED
|
@@ -6,13 +6,13 @@ from pathlib import Path
|
|
| 6 |
import soundfile as sf
|
| 7 |
import streamlit as st
|
| 8 |
|
|
|
|
| 9 |
from document_to_podcast.preprocessing import DATA_LOADERS, DATA_CLEANERS
|
| 10 |
from document_to_podcast.inference.model_loaders import (
|
| 11 |
load_llama_cpp_model,
|
| 12 |
-
|
| 13 |
)
|
| 14 |
from document_to_podcast.config import DEFAULT_PROMPT, DEFAULT_SPEAKERS, Speaker
|
| 15 |
-
from document_to_podcast.inference.text_to_speech import text_to_speech
|
| 16 |
from document_to_podcast.inference.text_to_text import text_to_text_stream
|
| 17 |
from document_to_podcast.utils import stack_audio_segments
|
| 18 |
|
|
@@ -26,7 +26,7 @@ def load_text_to_text_model():
|
|
| 26 |
|
| 27 |
@st.cache_resource
|
| 28 |
def load_text_to_speech_model():
|
| 29 |
-
return
|
| 30 |
|
| 31 |
|
| 32 |
script = "script"
|
|
@@ -167,7 +167,8 @@ if "clean_text" in st.session_state:
|
|
| 167 |
speech_model,
|
| 168 |
voice_profile,
|
| 169 |
)
|
| 170 |
-
st.audio(speech, sample_rate=speech_model.
|
|
|
|
| 171 |
st.session_state.audio.append(speech)
|
| 172 |
text = ""
|
| 173 |
|
|
@@ -179,7 +180,7 @@ if "clean_text" in st.session_state:
|
|
| 179 |
sf.write(
|
| 180 |
"podcast.wav",
|
| 181 |
st.session_state.audio,
|
| 182 |
-
samplerate=speech_model.
|
| 183 |
)
|
| 184 |
st.markdown("Podcast saved to disk!")
|
| 185 |
|
|
|
|
| 6 |
import soundfile as sf
|
| 7 |
import streamlit as st
|
| 8 |
|
| 9 |
+
from document_to_podcast.inference.text_to_speech import text_to_speech
|
| 10 |
from document_to_podcast.preprocessing import DATA_LOADERS, DATA_CLEANERS
|
| 11 |
from document_to_podcast.inference.model_loaders import (
|
| 12 |
load_llama_cpp_model,
|
| 13 |
+
load_tts_model,
|
| 14 |
)
|
| 15 |
from document_to_podcast.config import DEFAULT_PROMPT, DEFAULT_SPEAKERS, Speaker
|
|
|
|
| 16 |
from document_to_podcast.inference.text_to_text import text_to_text_stream
|
| 17 |
from document_to_podcast.utils import stack_audio_segments
|
| 18 |
|
|
|
|
| 26 |
|
| 27 |
@st.cache_resource
|
| 28 |
def load_text_to_speech_model():
|
| 29 |
+
return load_tts_model("OuteAI/OuteTTS-0.2-500M-GGUF/OuteTTS-0.2-500M-FP16.gguf")
|
| 30 |
|
| 31 |
|
| 32 |
script = "script"
|
|
|
|
| 167 |
speech_model,
|
| 168 |
voice_profile,
|
| 169 |
)
|
| 170 |
+
st.audio(speech, sample_rate=speech_model.sample_rate)
|
| 171 |
+
|
| 172 |
st.session_state.audio.append(speech)
|
| 173 |
text = ""
|
| 174 |
|
|
|
|
| 180 |
sf.write(
|
| 181 |
"podcast.wav",
|
| 182 |
st.session_state.audio,
|
| 183 |
+
samplerate=speech_model.sample_rate,
|
| 184 |
)
|
| 185 |
st.markdown("Podcast saved to disk!")
|
| 186 |
|