2023-02-19 17:04:48 +00:00
|
|
|
import streamlit as st
|
2023-02-21 12:19:03 +00:00
|
|
|
|
2023-02-19 17:04:48 +00:00
|
|
|
import modules.utilities as util
|
|
|
|
|
2023-02-19 17:13:17 +00:00
|
|
|
st.set_page_config(
|
|
|
|
page_title='GPT Brain'
|
|
|
|
)
|
|
|
|
|
2023-02-19 17:04:48 +00:00
|
|
|
# path
|
|
|
|
USER_DIR = '.user'
|
|
|
|
LOG_PATH = '.user/log'
|
|
|
|
BRAIN_MEMO = '.user/brain-memo.json'
|
|
|
|
MANIFEST = '.core/manifest.json'
|
2023-02-19 17:10:01 +00:00
|
|
|
INIT_LANGUAGE = '.user/language.json'
|
2023-02-19 17:04:48 +00:00
|
|
|
|
2023-02-21 12:19:03 +00:00
|
|
|
# exclude directory
|
2023-02-21 13:40:48 +00:00
|
|
|
EXCLUDE_DIR_OFFICIAL = ['__pycache__',
|
2023-02-21 12:19:03 +00:00
|
|
|
'.git',
|
|
|
|
'.idea',
|
|
|
|
'.vscode',
|
|
|
|
'.obsidian',
|
|
|
|
'.trash',
|
|
|
|
'.git',
|
|
|
|
'.gitignore',
|
|
|
|
'.gitattributes']
|
2023-02-19 17:04:48 +00:00
|
|
|
|
2023-02-21 12:19:03 +00:00
|
|
|
# activate session
|
2023-02-19 17:13:17 +00:00
|
|
|
if 'SESSION_LANGUAGE' not in st.session_state:
|
|
|
|
st.session_state['SESSION_LANGUAGE'] = util.read_json_at(INIT_LANGUAGE, 'SESSION_LANGUAGE')
|
2023-02-19 17:04:48 +00:00
|
|
|
|
|
|
|
if 'FILTER_ROW_COUNT' not in st.session_state:
|
|
|
|
st.session_state['FILTER_ROW_COUNT'] = util.read_json_at(BRAIN_MEMO, 'filter_row_count')
|
|
|
|
|
|
|
|
# models
|
2023-02-19 17:10:01 +00:00
|
|
|
MODELS_OPTIONS = ['text-davinci-003', 'text-curie-001', 'text-babbage-001', 'text-ada-001']
|