mirror of
https://github.com/sean1832/GPT-Brain
synced 2024-11-18 21:25:53 +00:00
eb5361ff80
A new feature that allows users to apply a filter to directories when selecting files, with the purpose of excluding specific directories and their contents from being displayed. The filter can help AI to focus on relevant files and avoid distractions or irrelevant information. This feature could be especially useful for users who work with large and complex vault.
36 lines
942 B
Python
36 lines
942 B
Python
import streamlit as st
|
|
|
|
import modules.utilities as util
|
|
|
|
st.set_page_config(
|
|
page_title='GPT Brain'
|
|
)
|
|
|
|
# path
|
|
USER_DIR = '.user'
|
|
LOG_PATH = '.user/log'
|
|
BRAIN_MEMO = '.user/brain-memo.json'
|
|
MANIFEST = '.core/manifest.json'
|
|
INIT_LANGUAGE = '.user/language.json'
|
|
|
|
# exclude directory
|
|
EXCLUDE_DIR_OFFICIAL = ['__pycache__',
|
|
'.git',
|
|
'.idea',
|
|
'.vscode',
|
|
'.obsidian',
|
|
'.trash',
|
|
'.git',
|
|
'.gitignore',
|
|
'.gitattributes']
|
|
|
|
# activate session
|
|
if 'SESSION_LANGUAGE' not in st.session_state:
|
|
st.session_state['SESSION_LANGUAGE'] = util.read_json_at(INIT_LANGUAGE, 'SESSION_LANGUAGE')
|
|
|
|
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
|
|
MODELS_OPTIONS = ['text-davinci-003', 'text-curie-001', 'text-babbage-001', 'text-ada-001']
|