Skip to content

Commit 27a084c

Browse files
committed
document loader bug fixed
1 parent 5b2802b commit 27a084c

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

demogpt/chains/prompts/task_list/ui_input_file.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
99
temp_file.write(uploaded_file.read())
1010
{variable} = temp_file.name # it shows the file path
11+
else:
12+
{variable} = ''
1113
1214
Suppose that, streamlit has been imported by "import streamlit as st" so you don't need to import it.
1315
Here is the part of the code that you are supposed to continue:

demogpt/chains/task_chains.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def docLoad(cls, task, code_snippets):
190190
def stringToDoc(cls, task, code_snippets):
191191
argument = task["input_key"]
192192
variable = task["output_key"]
193-
code = f'{variable} = "".join([doc.page_content for doc in {argument}])'
194193
code = f"""
195194
from langchain.docstore.document import Document
196195
{variable} = [Document(page_content={argument}, metadata={{'source': 'local'}})]

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ openai = "*"
2424
python-dotenv = "*"
2525
unstructured = "*"
2626
pdf2image = "*"
27-
pdfminer = "*"
2827
pdfminer-six = "*"
2928

3029
[tool.poetry.dev-dependencies]

0 commit comments

Comments
 (0)