speech-to-text / app.py
cptsubtext
Add first layout
802d13a
raw
history blame
910 Bytes
import streamlit as st
import requests
import os
# Variables
api_token = st.secrets["API_TOKEN"]
# Page Title
st.set_page_config(
page_title="Speech-to-Text Transcription App", page_icon="πŸ‘„", layout="wide"
)
def _max_width_():
max_width_str = f"max-width: 1200px;"
st.markdown(
f"""
<style>
.reportview-container .main .block-container{{
{max_width_str}
}}
</style>
""",
unsafe_allow_html=True,
)
_max_width_()
st.image("logo.png", width=350)
def main():
pages = {
"πŸ‘Ύ Free mode (2MB per API call)": demo,
"πŸ€— Full mode": API_key,
}
if "page" not in st.session_state:
st.session_state.update(
{
# Default page
"page": "Home",
}
)
with st.sidebar:
page = st.radio("Select your mode", tuple(pages.keys()))
pages[page]()