Skip to content

Commit

Permalink
Merge pull request #32 from hhlohwv/main
Browse files Browse the repository at this point in the history
Fix errors associated with trying to incorporate FAISS into workflow
  • Loading branch information
Plikt authored Mar 12, 2024
2 parents be9dfb2 + 16f2e16 commit 489b7b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/langchain_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import pyalex
import PyPDF2
import io
#import tiktoken
import tiktoken
#from demo import read_single

#TODO: IF doi -> then search open alex -> determine relevant metadata to return. -> Together once everything is up to date.
Expand Down Expand Up @@ -384,10 +384,10 @@ async def langchain_paper_search(node):
document = Document(page_content = text)

splitter = RecursiveCharacterTextSplitter(chunk_size = 5000, chunk_overlap = 1000)
texts = splitter.split_documents(document)
split_texts = splitter.split_text(text)
embeddings = OpenAIEmbeddings()

db = FAISS.from_documents(texts, embeddings)
db = FAISS.from_texts(split_texts, embeddings)
print("Database built...\n")

# Define all the queries and corresponding schemas in a list
queries_schemas_docs = [
Expand Down
Binary file modified app/requirements.txt
Binary file not shown.

0 comments on commit 489b7b1

Please sign in to comment.