Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
from PIL import Image
|
| 4 |
-
import numpy as np
|
| 5 |
|
| 6 |
# Stage 1: Image to Caption
|
| 7 |
@st.cache_resource
|
|
@@ -27,7 +26,7 @@ def text2story(description):
|
|
| 27 |
# Stage 3: Story to Speech
|
| 28 |
@st.cache_resource
|
| 29 |
def load_tts():
|
| 30 |
-
return pipeline("text-to-speech", model="
|
| 31 |
|
| 32 |
def story_to_audio(story_text):
|
| 33 |
tts = load_tts()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
from PIL import Image
|
|
|
|
| 4 |
|
| 5 |
# Stage 1: Image to Caption
|
| 6 |
@st.cache_resource
|
|
|
|
| 26 |
# Stage 3: Story to Speech
|
| 27 |
@st.cache_resource
|
| 28 |
def load_tts():
|
| 29 |
+
return pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech")
|
| 30 |
|
| 31 |
def story_to_audio(story_text):
|
| 32 |
tts = load_tts()
|