|
import streamlit as st |
|
|
|
def initialize_session(): |
|
|
|
if 'current_page' not in st.session_state: |
|
st.session_state['current_page'] = 'Login' |
|
|
|
|
|
|
|
if 'login_pressed' in st.session_state: |
|
st.session_state['login_pressed'] = False |
|
|
|
if 'user_id' not in st.session_state: |
|
st.session_state['user_id'] = None |
|
|
|
if 'user_name' not in st.session_state: |
|
st.session_state['user_id'] = None |
|
|
|
if 'user_is_connected' not in st.session_state: |
|
st.session_state['user_is_connected'] = False |
|
|
|
|
|
|
|
if 'signup_pressed' in st.session_state: |
|
st.session_state['signup_pressed'] = False |
|
|
|
|
|
|
|
if 'chat_history' not in st.session_state: |
|
st.session_state['chat_history'] = {} |
|
|
|
if 'selected_chat' not in st.session_state: |
|
st.session_state['selected_chat'] = {} |
|
|
|
if 'user_question' not in st.session_state: |
|
st.session_state['user_question'] = '' |
|
|
|
if 'chat_id' not in st.session_state: |
|
st.session_state['chat_id'] = None |
|
|
|
if 'file_content' not in st.session_state: |
|
st.session_state['file_content'] = '' |
|
|
|
if 'have_file' not in st.session_state: |
|
st.session_state['have_file'] = False |
|
|
|
if 'model_selected' not in st.session_state: |
|
st.session_state['model_selected'] = "Bert" |
|
|
|
if 'model_selected_bln' not in st.session_state: |
|
st.session_state['model_selected_bln'] = False |
|
|
|
if 'languages' not in st.session_state: |
|
st.session_state['languages'] = "en" |
|
|
|
if 'is_chat_show' not in st.session_state: |
|
st.session_state['is_chat_show'] = False |
|
|