import os import time import base64 import streamlit as st st.set_page_config(page_title='StoicCyber', page_icon="🏛️", layout="centered", initial_sidebar_state="collapsed") # show background image def get_base64_of_bin_file2(bin_file): with open(bin_file, 'rb') as f: data = f.read() return base64.b64encode(data).decode() def set_png_as_page_bg(png_file): bin_str = get_base64_of_bin_file2(png_file) page_bg_img = ''' ''' % bin_str st.markdown(page_bg_img, unsafe_allow_html=True) return set_png_as_page_bg('pxfuel.jpg') # header original_title = '

STOIC Ω CYBER

' st.markdown(original_title, unsafe_allow_html=True) @st.cache_resource def load_model(): # return load() pass # chat componenets def get_response(user_question): progress_text = "Loading model. Please wait." my_bar = st.progress(0, text=progress_text) # run the functions in the place of time sleep time. sleep(1) my_bar.progress(0.3, "Loading Model. Please wait.") time. sleep(5) my_bar.progress(0.6, "Generating Answer. Please wait.") time. sleep(5) my_bar.progress(0.9, "Post Processing. Please wait.") time. sleep(5) my_bar.progress(1.0, "Done") time. sleep(1) my_bar.empty() return "I don't know!" user_question = st.chat_input('What do you want to ask ..') if user_question is not None and user_question!="": with st.chat_message("Human", avatar="🧔🏻"): st.write(user_question) response = get_response(user_question) with st.chat_message("AI", avatar="🏛️"): st.write(response) # Hide footer and header hide_st_style = """ """ st.markdown(hide_st_style, unsafe_allow_html=True)