Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| import numpy | |
| from transformers import pipeline | |
| from IPython.display import Audio | |
| classifier = pipeline("text-to-speech", model="GuGai/text_to_speech_G") | |
| def main(): | |
| st.title("Text to Speech") | |
| with st.form("text_field"): | |
| text = st.text_area('enter some text:') | |
| # clicked==True only when the button is clicked | |
| clicked = st.form_submit_button("Submit text") | |
| if clicked: | |
| results = classifier(text) | |
| st.json(results) | |
| Audio(results['audio'], rate=results['sampling_rate']) | |
| if __name__ == "__main__": | |
| main() |