Spaces:
Build error
Build error
Pietro Lesci
commited on
Commit
·
ad93604
1
Parent(s):
e48d543
delete old app.py
Browse files
app.py
DELETED
|
@@ -1,69 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
from src import session_state
|
| 4 |
-
from src.configs import SupportedFiles
|
| 5 |
-
from src.pages import about, faq, home
|
| 6 |
-
from src.utils import get_logo
|
| 7 |
-
|
| 8 |
-
# app configs
|
| 9 |
-
st.set_page_config(
|
| 10 |
-
page_title="Wordify",
|
| 11 |
-
layout="wide",
|
| 12 |
-
page_icon="./assets/logo.png",
|
| 13 |
-
)
|
| 14 |
-
|
| 15 |
-
# session state
|
| 16 |
-
session = session_state.get(
|
| 17 |
-
process=False, run_id=0, posdf=None, negdf=None, uploaded_file_id=0
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
# ==== SIDEBAR ==== #
|
| 22 |
-
# LOGO
|
| 23 |
-
client_logo = get_logo("./assets/logo.png")
|
| 24 |
-
with st.sidebar.beta_container():
|
| 25 |
-
st.image(client_logo)
|
| 26 |
-
|
| 27 |
-
# NAVIGATION
|
| 28 |
-
PAGES = {
|
| 29 |
-
"Home": home,
|
| 30 |
-
"FAQ": faq,
|
| 31 |
-
"About": about,
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
st.sidebar.header("Navigation")
|
| 35 |
-
# with st.sidebar.beta_container():
|
| 36 |
-
selection = st.sidebar.radio("Go to", list(PAGES.keys()))
|
| 37 |
-
page = PAGES[selection]
|
| 38 |
-
|
| 39 |
-
# FILE UPLOADER
|
| 40 |
-
st.sidebar.markdown("")
|
| 41 |
-
st.sidebar.markdown("")
|
| 42 |
-
st.sidebar.header("Upload file")
|
| 43 |
-
# with st.sidebar.beta_container():
|
| 44 |
-
uploaded_file = st.sidebar.file_uploader(
|
| 45 |
-
"Select file", type=[i.name for i in SupportedFiles]
|
| 46 |
-
)
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
# FOOTER
|
| 50 |
-
# with st.sidebar.beta_container():
|
| 51 |
-
st.sidebar.markdown("")
|
| 52 |
-
st.sidebar.markdown("")
|
| 53 |
-
st.sidebar.markdown(
|
| 54 |
-
"""
|
| 55 |
-
<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>
|
| 56 |
-
""",
|
| 57 |
-
unsafe_allow_html=True,
|
| 58 |
-
)
|
| 59 |
-
st.sidebar.info(
|
| 60 |
-
"Something not working? Consider [filing an issue](https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new)"
|
| 61 |
-
)
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
# ==== MAIN ==== #
|
| 65 |
-
with st.beta_container():
|
| 66 |
-
st.title("Wordify")
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
page.write(session, uploaded_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|