Spaces:
Paused
Paused
Update helper_functions.py
Browse files- helper_functions.py +2 -2
helper_functions.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from langchain_community.document_loaders import
|
| 2 |
from langchain_community.vectorstores import Qdrant
|
| 3 |
import os
|
| 4 |
import requests
|
|
@@ -25,7 +25,7 @@ def load_documents_from_url(url):
|
|
| 25 |
# Check if it's a PDF
|
| 26 |
if url.endswith(".pdf"):
|
| 27 |
try:
|
| 28 |
-
loader =
|
| 29 |
return loader.load()
|
| 30 |
except Exception as e:
|
| 31 |
print(f"Error loading PDF from {url}: {e}")
|
|
|
|
| 1 |
+
from langchain_community.document_loaders import PyMuPDFLoader, TextLoader, UnstructuredURLLoader
|
| 2 |
from langchain_community.vectorstores import Qdrant
|
| 3 |
import os
|
| 4 |
import requests
|
|
|
|
| 25 |
# Check if it's a PDF
|
| 26 |
if url.endswith(".pdf"):
|
| 27 |
try:
|
| 28 |
+
loader = PyMuPDFLoader(url)
|
| 29 |
return loader.load()
|
| 30 |
except Exception as e:
|
| 31 |
print(f"Error loading PDF from {url}: {e}")
|