fixed example in test.env not matching local_app.py (thanks brookssw)

This commit is contained in:
ethan
2023-05-31 15:13:31 -07:00
parent 3c684ccdac
commit dea160edd9
2 changed files with 4 additions and 4 deletions

View File

@@ -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:

View File

@@ -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))