danicafisher commited on
Commit
0d20107
·
1 Parent(s): 217f9ad

Tests langchain

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -15,11 +15,18 @@ import asyncio
15
  import nest_asyncio
16
  nest_asyncio.apply()
17
 
 
18
 
19
- pdf_loader_NIST = PDFFileLoader("data/NIST.AI.600-1.pdf")
20
- pdf_loader_Blueprint = PDFFileLoader("data/Blueprint-for-an-AI-Bill-of-Rights.pdf")
21
- documents_NIST = pdf_loader_NIST.load_documents()
22
- documents_Blueprint = pdf_loader_Blueprint.load_documents()
 
 
 
 
 
 
23
 
24
  text_splitter = CharacterTextSplitter()
25
  split_documents_NIST = text_splitter.split_texts(documents_NIST)
 
15
  import nest_asyncio
16
  nest_asyncio.apply()
17
 
18
+ from langchain_community.document_loaders import PyMuPDFLoader
19
 
20
+ filepath_NIST = "data/NIST.AI.600-1.pdf"
21
+ filepath_Blueprint = "data/Blueprint-for-an-AI-Bill-of-Rights.pdf"
22
+
23
+ documents_NIST = PyMuPDFLoader(filepath_NIST).load()
24
+ documents_Blueprint = PyMuPDFLoader(filepath_Blueprint).load()
25
+
26
+ # pdf_loader_NIST = PDFFileLoader("data/NIST.AI.600-1.pdf")
27
+ # pdf_loader_Blueprint = PDFFileLoader("data/Blueprint-for-an-AI-Bill-of-Rights.pdf")
28
+ # documents_NIST = pdf_loader_NIST.load_documents()
29
+ # documents_Blueprint = pdf_loader_Blueprint.load_documents()
30
 
31
  text_splitter = CharacterTextSplitter()
32
  split_documents_NIST = text_splitter.split_texts(documents_NIST)