Spaces:
Runtime error
Runtime error
minor fix
Browse files- app/rag.py +2 -3
app/rag.py
CHANGED
@@ -22,7 +22,6 @@ from llama_index.llms.llama_cpp import LlamaCPP
|
|
22 |
from llama_index.embeddings.fastembed import FastEmbedEmbedding
|
23 |
|
24 |
|
25 |
-
|
26 |
class ChatPDF:
|
27 |
logging.basicConfig(level=logging.INFO)
|
28 |
logger = logging.getLogger(__name__)
|
@@ -85,12 +84,12 @@ class ChatPDF:
|
|
85 |
# Settings.tokenzier = tokenizer
|
86 |
Settings.transformations = [text_parser]
|
87 |
|
88 |
-
def ingest(self,
|
89 |
text_chunks = []
|
90 |
doc_ids = []
|
91 |
nodes = []
|
92 |
|
93 |
-
docs = SimpleDirectoryReader(input_dir=
|
94 |
|
95 |
self.logger.info("enumerating docs")
|
96 |
for doc_idx, doc in enumerate(docs):
|
|
|
22 |
from llama_index.embeddings.fastembed import FastEmbedEmbedding
|
23 |
|
24 |
|
|
|
25 |
class ChatPDF:
|
26 |
logging.basicConfig(level=logging.INFO)
|
27 |
logger = logging.getLogger(__name__)
|
|
|
84 |
# Settings.tokenzier = tokenizer
|
85 |
Settings.transformations = [text_parser]
|
86 |
|
87 |
+
def ingest(self, files_dir: str):
|
88 |
text_chunks = []
|
89 |
doc_ids = []
|
90 |
nodes = []
|
91 |
|
92 |
+
docs = SimpleDirectoryReader(input_dir=files_dir).load_data()
|
93 |
|
94 |
self.logger.info("enumerating docs")
|
95 |
for doc_idx, doc in enumerate(docs):
|