Spaces:
Build error
Build error
File size: 1,493 Bytes
8744085 6114f21 8744085 6114f21 8744085 6114f21 8744085 6114f21 8744085 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
import streamlit as st
from src.utils import get_logo
from src import session_state
from src.pages import (
home,
faq,
about,
)
from src.configs import SupportedFiles
# app configs
st.set_page_config(
page_title="Wordify",
layout="wide",
page_icon="./assets/logo.png",
)
# session state
session = session_state.get(process=False, run_id=0, posdf=None, negdf=None, uploaded_file_id=0)
# ==== SIDEBAR ==== #
# LOGO
client_logo = get_logo("./assets/logo.png")
with st.sidebar.beta_container():
st.image(client_logo)
# NAVIGATION
PAGES = {
"Home": home,
"FAQ": faq,
"About": about,
}
st.sidebar.header("Navigation")
# with st.sidebar.beta_container():
selection = st.sidebar.radio("Go to", list(PAGES.keys()))
page = PAGES[selection]
# FILE UPLOADER
st.sidebar.markdown("")
st.sidebar.markdown("")
st.sidebar.header("Upload file")
# with st.sidebar.beta_container():
uploaded_file = st.sidebar.file_uploader("Select file", type=[i.name for i in SupportedFiles])
# FOOTER
# with st.sidebar.beta_container():
st.sidebar.markdown("")
st.sidebar.markdown("")
st.sidebar.markdown(
"""
<span style="font-size: 0.75em">Built with ♥ by [`Pietro Lesci`](https://pietrolesci.github.io/) and [`MilaNLP`](https://twitter.com/MilaNLProc?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor)</span>
""",
unsafe_allow_html=True,
)
# ==== MAIN ==== #
with st.beta_container():
st.title("Wordify")
page.write(session, uploaded_file) |