atoye1's picture
pushing for deployment
18fb155
import time
import streamlit as st
from st_components.render_key_state import render_key_state
from streamlit_extras.bottom_container import bottom
@st.experimental_fragment(run_every=1)
def print_credit_time():
current_time = time.strftime("%H:%M:%S")
st.write("Made with โค๏ธ by [Busan AI](https://busanai.com), time => ", current_time)
def render_footer(st: st):
with bottom():
col1, col2, col3 = st.columns([1, 1, 1])
with col1:
if st.session_state.selected_dataset is not None:
st.success(f"โœจ ๋ฐ์ดํ„ฐ๊ฐ€ ์„ ํƒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.: {st.session_state.selected_dataset}")
else:
st.error("๐Ÿšจ ๋ฐ์ดํ„ฐ๋ฅผ ์„ ํƒํ•ด์ฃผ์„ธ์š”.")
with col2:
render_key_state(st)
with col3:
with st.popover(label='โš™๏ธ ๊ณ ๊ธ‰ ์„ค์ • ๋ณ€๊ฒฝํ•˜๊ธฐ', use_container_width=True):
st.write("### LLM")
models = ["gpt-4o", "gpt-4", "gpt-3.5-turbo"]
selected_model = st.selectbox(
'์–ธ์–ด๋ชจ๋ธ ์„ ํƒ',
options=models,
key='selected_model'
)
use_cache = st.selectbox("์บ์‹œ ์‚ฌ์šฉ", options=[True, False], index=0, key='use_cache')
temperature = st.slider(
label="์ž์œ ๋„ ์„ ํƒ",
min_value=0.0,
max_value=1.0,
key='temperature',
)
# ๊ฐ€๋กœ์„ 
st.divider()
st.write("### Summarization")
summarization_methods = [
{"label": "llm",
"description": "๊ธฐ๋ณธ ์š”์•ฝ์— ์ฃผ์„์„ ์ถ”๊ฐ€ํ•˜๊ธฐ ์œ„ํ•ด LLM์„ ์‚ฌ์šฉํ•˜์—ฌ ์—ด์˜ ์˜๋ฏธ ์œ ํ˜• ๋ฐ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์„ค๋ช…๊ณผ ๊ฐ™์€ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค."},
{"label": "default",
"description": "๋ฐ์ดํ„ฐ ์„ธํŠธ ์—ด ํ†ต๊ณ„ ๋ฐ ์—ด ์ด๋ฆ„์„ ์š”์•ฝ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค."},
{"label": "columns",
"description": "๋ฐ์ดํ„ฐ ์„ธํŠธ ์—ด ์ด๋ฆ„์„ ์š”์•ฝ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค."}
]
selected_method_label = st.selectbox(
'์š”์•ฝ ๋ฐฉ๋ฒ• ์„ ํƒ',
options=[method["label"] for method in summarization_methods],
index=0,
key='selected_method',
)
selected_method = summarization_methods[[
method["label"] for method in summarization_methods].index(selected_method_label)]["label"]
# add description of selected method in very small font to sidebar
selected_summary_method_description = summarization_methods[[
method["label"] for method in summarization_methods].index(selected_method_label)]["description"]
if selected_method:
st.markdown(
f"<span> {selected_summary_method_description} </span>",
unsafe_allow_html=True)
st.divider()
st.write("### Visualization")
visualization_libraries = ["seaborn", "matplotlib", "plotly", "altair"]
selected_library = st.selectbox(
'์‹œ๊ฐํ™” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ ํƒ',
options=visualization_libraries,
key='selected_library')
custom_css = """
<style>
.custom-made-with {
padding: 5px;
border-radius: 5px;
text-align: center;
transition: background-color 0.3s, color 0.3s;
margin-top: -25px;
}
/* ๋ฐ์€ ๋ชจ๋“œ */
@media (prefers-color-scheme: light) {
.custom-made-with {
background-color: #f0f0f0; /* ํšŒ์ƒ‰ ๋ฐฐ๊ฒฝ */
color: #000000; /* ๊ฒ€์€์ƒ‰ ๊ธ€์”จ */
}
}
/* ์–ด๋‘์šด ๋ชจ๋“œ */
@media (prefers-color-scheme: dark) {
.custom-made-with {
background-color: #333333; /* ์–ด๋‘์šด ํšŒ์ƒ‰ ๋ฐฐ๊ฒฝ */
color: #ffffff; /* ํฐ์ƒ‰ ๊ธ€์”จ */
}
}
</style>"""
# CSS๋ฅผ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
st.markdown(custom_css, unsafe_allow_html=True)
# HTML๋กœ ๋‚ด์šฉ์„ ์ž‘์„ฑํ•˜๊ณ  CSS ํด๋ž˜์Šค๋ฅผ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
st.markdown(
body='<div class="custom-made-with">Developed with ๐Ÿ”ฅ by Donghun Seol, ssalssi1@gmail.com</div>',
unsafe_allow_html=True)