mirror of
https://github.com/e-johnstonn/BriefGPT.git
synced 2026-01-08 21:38:15 -05:00
fixed example in test.env not matching local_app.py (thanks brookssw)
This commit is contained in:
@@ -30,10 +30,10 @@ loading = st.spinner('Initializing LLM')
|
||||
with st.spinner('Initializing LLM...'):
|
||||
if 'llm' not in st.session_state:
|
||||
with st.spinner('Loading LLM...'):
|
||||
if model_type == 'LlamaCpp':
|
||||
if model_type.lower() == 'LlamaCpp'.lower():
|
||||
llm = LlamaCpp(model_path=model_path, n_ctx=1000)
|
||||
st.session_state.llm = llm
|
||||
elif model_type == 'GPT4All':
|
||||
elif model_type.lower() == 'GPT4All'.lower():
|
||||
llm = GPT4All(model=model_path, backend='gptj', n_ctx=1000)
|
||||
st.session_state.llm = llm
|
||||
else:
|
||||
|
||||
@@ -29,7 +29,7 @@ def doc_loader(file_path: str):
|
||||
:return: A langchain Document object.
|
||||
"""
|
||||
if file_path.endswith('.txt'):
|
||||
loader = TextLoader(file_path, encoding='utf-8')
|
||||
loader = TextLoader(file_path)
|
||||
elif file_path.endswith('.pdf'):
|
||||
loader = PyPDFLoader(file_path)
|
||||
elif file_path.endswith('.epub'):
|
||||
@@ -48,7 +48,7 @@ def directory_loader(directory):
|
||||
mixed_documents = []
|
||||
for file in files:
|
||||
if file.endswith('.txt'):
|
||||
loader = TextLoader(os.path.join(directory, file), encoding='utf-8')
|
||||
loader = TextLoader(os.path.join(directory, file))
|
||||
documents.append(loader.load())
|
||||
elif file.endswith('.pdf'):
|
||||
loader = PyPDFLoader(os.path.join(directory, file))
|
||||
|
||||
Reference in New Issue
Block a user