Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from tool import KokoroText2Speech
|
| 3 |
+
|
| 4 |
+
st.title('Let your smolagents' agent generate audio from text')
|
| 5 |
+
text = '''The sky above the port was the color of television, tuned to a dead channel.'''
|
| 6 |
+
input_text = st.text_input('text to process', value=text)
|
| 7 |
+
if st.button('Generate'):
|
| 8 |
+
with st.spinner():
|
| 9 |
+
|
| 10 |
+
tool = KokoroText2Speech()
|
| 11 |
+
output = tool(input_text)
|
| 12 |
+
st.audio(output.numpy(), sample_rate=24000)
|