Spaces:
Sleeping
Sleeping
Commit
Β·
8d9d2f1
1
Parent(s):
a1b4309
Disable Mic in Production
Browse files
app.py
CHANGED
@@ -61,7 +61,19 @@ st.set_page_config(page_title="AI-Blogger",
|
|
61 |
layout='centered' )
|
62 |
|
63 |
st.header("AI Blogger π€", divider='rainbow')
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
col1,col2=st.columns([20,3])
|
67 |
with col1:
|
@@ -69,10 +81,9 @@ with col1:
|
|
69 |
text = st.empty()
|
70 |
input_text = text.text_input("Enter the Blog Topic")
|
71 |
|
72 |
-
|
73 |
with col2:
|
74 |
st.write(':grey[.]')
|
75 |
-
recorder = st.button("ποΈ", help="Blog Topic by Voice")
|
76 |
|
77 |
if recorder:
|
78 |
recorded_text = record_audio()
|
|
|
61 |
layout='centered' )
|
62 |
|
63 |
st.header("AI Blogger π€", divider='rainbow')
|
64 |
+
hide_streamlit_style = """
|
65 |
+
<style>
|
66 |
+
#MainMenu {visibility: hidden;}
|
67 |
+
footer {visibility: hidden;}
|
68 |
+
</style>
|
69 |
+
|
70 |
+
"""
|
71 |
+
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
72 |
+
#? Make it False in DEV Mode
|
73 |
+
button_disabled = True
|
74 |
+
# Button with info hover
|
75 |
+
if button_disabled:
|
76 |
+
st.toast("Mic Button is disabled in production. HF Don't have Audio Device")
|
77 |
|
78 |
col1,col2=st.columns([20,3])
|
79 |
with col1:
|
|
|
81 |
text = st.empty()
|
82 |
input_text = text.text_input("Enter the Blog Topic")
|
83 |
|
|
|
84 |
with col2:
|
85 |
st.write(':grey[.]')
|
86 |
+
recorder = st.button("ποΈ", help="Blog Topic by Voice", key="mic", disabled=button_disabled)
|
87 |
|
88 |
if recorder:
|
89 |
recorded_text = record_audio()
|