Skip to content

Commit

Permalink
fixed example in test.env not matching local_app.py (thanks brookssw)
Browse files Browse the repository at this point in the history
  • Loading branch information
e-johnstonn committed May 31, 2023
1 parent 3c684cc commit dea160e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions local_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
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:
Expand Down
4 changes: 2 additions & 2 deletions summary_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand All @@ -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))
Expand Down

0 comments on commit dea160e

Please sign in to comment.