angry-meow commited on
Commit
26e0da2
1 Parent(s): 4fb1a37

file loading testing

Browse files
Files changed (1) hide show
  1. helper_functions.py +2 -2
helper_functions.py CHANGED
@@ -1,6 +1,6 @@
1
  from typing import List
2
  from langchain.agents import AgentExecutor, create_openai_functions_agent
3
- from langchain_community.document_loaders import PyMuPDFLoader, TextFileLoader, UnstructuredURLLoader, WebBaseLoader
4
  from langchain_community.vectorstores import Qdrant
5
  from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
6
  from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
@@ -35,7 +35,7 @@ def process_file(uploaded_file: AskFileResponse):
35
  with open(temp_file_path, "wb") as f:
36
  f.write(uploaded_file.content)
37
  # Load text file with TextLoader
38
- loader = TextFileLoader(temp_file_path)
39
  else:
40
  raise ValueError("Unsupported file format. Only PDF and TXT are supported.")
41
 
 
1
  from typing import List
2
  from langchain.agents import AgentExecutor, create_openai_functions_agent
3
+ from langchain_community.document_loaders import PyMuPDFLoader, TextLoader, UnstructuredURLLoader, WebBaseLoader
4
  from langchain_community.vectorstores import Qdrant
5
  from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
6
  from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
 
35
  with open(temp_file_path, "wb") as f:
36
  f.write(uploaded_file.content)
37
  # Load text file with TextLoader
38
+ loader = TextLoader(temp_file_path)
39
  else:
40
  raise ValueError("Unsupported file format. Only PDF and TXT are supported.")
41