Spaces:
Build error
Build error
Download src/modules/layout.py from niro-private/chatCSV: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/spaces/niro-private/chatCSV/resolve/main/src/modules/layout.py
- Command line
-
hf download hf://spaces/niro-private/chatCSV/src/modules/layout.py
-
curl -L -o layout.py https://huggingface.co/spaces/niro-private/chatCSV/resolve/main/src/modules/layout.py
1.67 kB
| import streamlit as st | |
| class Layout: | |
| def show_header_txt(self): | |
| """ | |
| Displays the header of the app | |
| """ | |
| # st.image('assets/Images/colleen-logo.png', width=400) | |
| st.markdown( | |
| """ | |
| <h1 style='text-align: center;'>LedgerGPT by Colleen.AI, Talk with your ledger data! 💬</h1> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| def show_header(self): | |
| """ | |
| Displays the header of the app | |
| """ | |
| st.markdown( | |
| """ | |
| <h1 style='text-align: center;'>ChatBot-CSV, Talk with your csv data! 💬</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 😉</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 | |