Spaces:
Runtime error
Runtime error
Commit
•
604c4aa
1
Parent(s):
46a0f72
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from langchain.document_loaders import
|
2 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
3 |
from langchain.embeddings import HuggingFaceEmbeddings
|
4 |
from langchain.vectorstores import Chroma
|
@@ -12,17 +12,8 @@ import gradio as gr
|
|
12 |
import time
|
13 |
|
14 |
|
15 |
-
# Loading the PDF files
|
16 |
-
loader =
|
17 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Business_Data_Science_Curriculum.pdf",
|
18 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Finance_Aalborg_University.pdf",
|
19 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Finance_Curriculum.pdf",
|
20 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Innovation_Management_Aalborg_University.pdf",
|
21 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Innovation_Management_Curriculumn_2023.pdf",
|
22 |
-
"AAUs_Cand_Merc_Masters_Chatbot/International_Business_Aalborg_University.pdf",
|
23 |
-
"AAUs_Cand_Merc_Masters_Chatbot/International_Business_Curriculum.pdf",
|
24 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Marketing_and_Sales_Aalborg_University.pdf",
|
25 |
-
"AAUs_Cand_Merc_Masters_Chatbot/Marketing_and_Sales_Curriculumn.pdf")
|
26 |
docs = loader.load()
|
27 |
|
28 |
# Splitting the text in smaller chunks
|
|
|
1 |
+
from langchain.document_loaders import PyPDFDirectoryLoader
|
2 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
3 |
from langchain.embeddings import HuggingFaceEmbeddings
|
4 |
from langchain.vectorstores import Chroma
|
|
|
12 |
import time
|
13 |
|
14 |
|
15 |
+
# Loading the PDF files
|
16 |
+
loader = PyPDFDirectoryLoader("data")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
docs = loader.load()
|
18 |
|
19 |
# Splitting the text in smaller chunks
|