Spaces:
Runtime error
Runtime error
Download modules/layout.py from RustX/CSV-ChatBot: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/spaces/RustX/CSV-ChatBot/resolve/4f4e4a3cd4eb859632fd7c8eb0ff0e9636038ce8/modules/layout.py
- Command line
-
hf download hf://spaces/RustX/CSV-ChatBot@4f4e4a3cd4eb859632fd7c8eb0ff0e9636038ce8/modules/layout.py
-
curl -L -o layout.py https://huggingface.co/spaces/RustX/CSV-ChatBot/resolve/4f4e4a3cd4eb859632fd7c8eb0ff0e9636038ce8/modules/layout.py
1.55 kB
| import streamlit as st | |
| class Layout: | |
| def show_header(self): | |
| """ | |
| Displays the header of the app | |
| """ | |
| st.markdown( | |
| """ | |
| <h1 style='text-align: center;'>CSV-ChatBot, Talk with your csv-data ! / CSV-ChatBot, csv ๋ฐ์ดํฐ๋ก ๋ํํ์ธ์! ๐ฌ</h1> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| def show_api_key_missing(self): | |
| """ | |
| Displays a message if the user has not entered an API key | |
| """ | |
| st.markdown( | |
| """ | |
| <div style='text-align: center;'> | |
| <h4>Enter your <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API key</a> to start chatting / ์ฑํ ์ ์์ํ๋ ค๋ฉด <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API ํค</a>๋ฅผ ์ ๋ ฅํ์ธ์. ๐</h4> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| def prompt_form(self): | |
| """ | |
| Displays the prompt form | |
| """ | |
| with st.form(key="my_form", clear_on_submit=True): | |
| user_input = st.text_area( | |
| "Query: / ์ง๋ฌธ:", | |
| placeholder="Ask me anything about the document... / ๋ฌธ์์ ๋ํด ๋ฌด์์ด๋ ๋ฌผ์ด๋ณด์ธ์...", | |
| key="input", | |
| label_visibility="collapsed", | |
| ) | |
| submit_button = st.form_submit_button(label="Send / ๋ณด๋ด์ฃผ์ธ์") | |
| is_ready = submit_button and user_input | |
| return is_ready, user_input |