Spaces:
Build error
Build error
File size: 1,459 Bytes
b748dad df4398a e48d543 b748dad e48d543 df4398a e48d543 b748dad |
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 |
import streamlit as st
from src.components import faq, footer, form, presentation
from src.utils import convert_df, get_logo, read_file
# app configs
st.set_page_config(
page_title="Wordify",
initial_sidebar_state="expanded",
layout="centered",
page_icon="./assets/logo.png",
menu_items={
"Get Help": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
"Report a Bug": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
"About": "By the __Wordify__ team.",
},
)
# logo
st.sidebar.image(get_logo("./assets/logo.png"))
# title
st.title("Wordify")
# file uploader
uploaded_fl = st.sidebar.file_uploader(
label="Choose a file",
type=["csv", "parquet", "tsv", "xlsx"],
accept_multiple_files=False,
help="""
Supported formats:
- CSV
- TSV
- PARQUET
- XLSX (do not support [Strict Open XML Spreadsheet format](https://stackoverflow.com/questions/62800822/openpyxl-cannot-read-strict-open-xml-spreadsheet-format-userwarning-file-conta))
""",
)
if not uploaded_fl:
presentation()
faq()
else:
df = read_file(uploaded_fl)
new_df = form(df)
if new_df is not None:
payload = convert_df(new_df)
st.download_button(
label="Download data as CSV",
data=payload,
file_name="wordify_results.csv",
mime="text/csv",
)
# footer
footer()
|