Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #439 rag document path #440

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/airunner/aihandler/casual_lm_transfformer_base_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import torch
from llama_index.core.base_query_engine import BaseQueryEngine
from transformers import AutoModelForCausalLM, TextIteratorStreamer
Expand All @@ -24,9 +23,7 @@ def __init__(self, *args, **kwargs):
self.documents = None
self.index = None
self.query_engine: BaseQueryEngine = None
self.documents_path = os.path.join(
"documents"#self.settings["path_settings"]["documents_path"]
)
self.documents_path = self.settings["path_settings"]["documents_path"]

def post_load(self):
super().post_load()
Expand Down Expand Up @@ -86,7 +83,8 @@ def load_service_context(self):
def load_documents(self):
self.logger.info(f"Loading documents from {self.documents_path}")
self.documents = SimpleDirectoryReader(
self.documents_path
self.documents_path,
exclude_hidden=False,
).load_data()

def load_index(self):
Expand Down