Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,8 @@ from langchain_core.documents import Document # Updated import
|
|
4 |
# from langchain_openai import OpenAIEmbeddings
|
5 |
from langchain_huggingface import HuggingFaceEmbeddings # Updated import
|
6 |
from langchain_community.vectorstores import Chroma
|
7 |
-
from
|
|
|
8 |
import os
|
9 |
import shutil # Added import
|
10 |
|
@@ -30,8 +31,7 @@ def load_documents():
|
|
30 |
if not os.path.exists(file_path):
|
31 |
print(f"Error: File {file_path} not found.")
|
32 |
return []
|
33 |
-
loader
|
34 |
-
= UnstructuredMarkdownLoader(file_path)
|
35 |
documents = loader.load()
|
36 |
return documents
|
37 |
|
|
|
4 |
# from langchain_openai import OpenAIEmbeddings
|
5 |
from langchain_huggingface import HuggingFaceEmbeddings # Updated import
|
6 |
from langchain_community.vectorstores import Chroma
|
7 |
+
from
|
8 |
+
dotenv import load_dotenv
|
9 |
import os
|
10 |
import shutil # Added import
|
11 |
|
|
|
31 |
if not os.path.exists(file_path):
|
32 |
print(f"Error: File {file_path} not found.")
|
33 |
return []
|
34 |
+
loader = UnstructuredMarkdownLoader(file_path)
|
|
|
35 |
documents = loader.load()
|
36 |
return documents
|
37 |
|