Spaces:
Sleeping
Sleeping
| import time | |
| import streamlit as st | |
| from st_components.render_key_state import render_key_state | |
| from streamlit_extras.bottom_container import bottom | |
| 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) |