Pranav4datasc commited on
Commit
5df35e3
·
verified ·
1 Parent(s): 5cd99af

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +26 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import requests
3
+ import base64
4
+
5
+ st.title("Text to Speech App - powered by Gradio, hosted on 🤗")
6
+ inp_text = st.text_input("Input text here to convert to speech")
7
+
8
+ button = st.button("⌨️Text to speech magic 🗣️")
9
+
10
+ if button:
11
+ with st.spinner():
12
+
13
+ response_json = requests.post("https://abidlabs-speak.hf.space/run/predict",json={
14
+ "data": [
15
+ inp_text,
16
+ ]}).json()
17
+
18
+ md = f"""
19
+ <audio controls>
20
+ <source src="{response_json['data'][0]}" type="audio/flac">
21
+ </audio>
22
+ """
23
+ st.markdown(
24
+ md,
25
+ unsafe_allow_html=True,
26
+ )
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit
2
+ requests