Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,11 +22,7 @@ from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext
|
|
22 |
from llama_index.llms import HuggingFaceLLM
|
23 |
from langchain_community.document_loaders import PyPDFLoader
|
24 |
|
25 |
-
|
26 |
-
files = [Path(dat_directory) / file for file in os.listdir(dat_directory)]
|
27 |
-
absolute_paths = [file.resolve() for file in files]
|
28 |
-
absolute_paths_strings = [str(file) for file in absolute_paths]
|
29 |
-
documents = [SimpleDirectoryReader(absolute_paths_strings[i]).load_data()[0] for i in range(len(absolute_paths_strings))]
|
30 |
documents = [CharacterTextSplitter(separator="\n", chunk_size=1000, chunk_overlap=0).split_text(doc) for doc in documents]
|
31 |
|
32 |
from llama_index.prompts.prompts import SimpleInputPrompt
|
|
|
22 |
from llama_index.llms import HuggingFaceLLM
|
23 |
from langchain_community.document_loaders import PyPDFLoader
|
24 |
|
25 |
+
documents = SimpleDirectoryReader("Dat").load_data()
|
|
|
|
|
|
|
|
|
26 |
documents = [CharacterTextSplitter(separator="\n", chunk_size=1000, chunk_overlap=0).split_text(doc) for doc in documents]
|
27 |
|
28 |
from llama_index.prompts.prompts import SimpleInputPrompt
|