diff --git a/demogpt/chains/prompts/task_list/ui_input_file.py b/demogpt/chains/prompts/task_list/ui_input_file.py index a5dea53..8bce075 100644 --- a/demogpt/chains/prompts/task_list/ui_input_file.py +++ b/demogpt/chains/prompts/task_list/ui_input_file.py @@ -8,6 +8,8 @@ with tempfile.NamedTemporaryFile(delete=False) as temp_file: temp_file.write(uploaded_file.read()) {variable} = temp_file.name # it shows the file path +else: + {variable} = '' Suppose that, streamlit has been imported by "import streamlit as st" so you don't need to import it. Here is the part of the code that you are supposed to continue: diff --git a/demogpt/chains/task_chains.py b/demogpt/chains/task_chains.py index c16c55e..8814c01 100644 --- a/demogpt/chains/task_chains.py +++ b/demogpt/chains/task_chains.py @@ -190,7 +190,6 @@ def docLoad(cls, task, code_snippets): def stringToDoc(cls, task, code_snippets): argument = task["input_key"] variable = task["output_key"] - code = f'{variable} = "".join([doc.page_content for doc in {argument}])' code = f""" from langchain.docstore.document import Document {variable} = [Document(page_content={argument}, metadata={{'source': 'local'}})] diff --git a/pyproject.toml b/pyproject.toml index 993ba74..708235a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ openai = "*" python-dotenv = "*" unstructured = "*" pdf2image = "*" -pdfminer = "*" pdfminer-six = "*" [tool.poetry.dev-dependencies]