Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -108,6 +108,11 @@ def add_file(history, file):
|
|
108 |
|
109 |
# Funktion, um für einen best. File-typ ein directory-loader zu definieren
|
110 |
def create_directory_loader(file_type, directory_path):
|
|
|
|
|
|
|
|
|
|
|
111 |
return DirectoryLoader(
|
112 |
path=directory_path,
|
113 |
glob=f"**/*{file_type}",
|
@@ -121,13 +126,7 @@ def document_loading_splitting():
|
|
121 |
##############################
|
122 |
# Document loading
|
123 |
docs = []
|
124 |
-
|
125 |
-
loaders = {
|
126 |
-
'.pdf': PyMuPDFLoader,
|
127 |
-
'.word': UnstructuredWordDocumentLoader,
|
128 |
-
}
|
129 |
-
|
130 |
-
|
131 |
# kreiere einen DirectoryLoader für jeden file type
|
132 |
pdf_loader = create_directory_loader('.pdf', './chroma/pdf')
|
133 |
word_loader = create_directory_loader('.word', './chroma/word')
|
|
|
108 |
|
109 |
# Funktion, um für einen best. File-typ ein directory-loader zu definieren
|
110 |
def create_directory_loader(file_type, directory_path):
|
111 |
+
#verscheidene Dokument loaders:
|
112 |
+
loaders = {
|
113 |
+
'.pdf': PyMuPDFLoader,
|
114 |
+
'.word': UnstructuredWordDocumentLoader,
|
115 |
+
}
|
116 |
return DirectoryLoader(
|
117 |
path=directory_path,
|
118 |
glob=f"**/*{file_type}",
|
|
|
126 |
##############################
|
127 |
# Document loading
|
128 |
docs = []
|
129 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
# kreiere einen DirectoryLoader für jeden file type
|
131 |
pdf_loader = create_directory_loader('.pdf', './chroma/pdf')
|
132 |
word_loader = create_directory_loader('.word', './chroma/word')
|