Spaces:
Paused
Paused
Hemang Thakur
commited on
Commit
·
eb560af
1
Parent(s):
08c6a9b
changed .env file path to writable directory in main.py file
Browse files
main.py
CHANGED
@@ -22,6 +22,9 @@ CONTEXT_LENGTH = 128000
|
|
22 |
BUFFER = 10000
|
23 |
MAX_TOKENS_ALLOWED = CONTEXT_LENGTH - BUFFER
|
24 |
|
|
|
|
|
|
|
25 |
# Per-session state
|
26 |
SESSION_STORE: Dict[str, Dict[str, Any]] = {}
|
27 |
|
@@ -44,11 +47,10 @@ def stop_on_error():
|
|
44 |
|
45 |
# Initialize the components
|
46 |
def initialize_components():
|
47 |
-
load_dotenv(override=True)
|
48 |
|
49 |
from src.search.search_engine import SearchEngine
|
50 |
from src.query_processing.query_processor import QueryProcessor
|
51 |
-
# from src.rag.neo4j_graphrag import Neo4jGraphRAG
|
52 |
from src.rag.graph_rag import GraphRAG
|
53 |
from src.evaluation.evaluator import Evaluator
|
54 |
from src.reasoning.reasoner import Reasoner
|
@@ -61,7 +63,6 @@ def initialize_components():
|
|
61 |
SESSION_STORE['search_engine'] = SearchEngine()
|
62 |
SESSION_STORE['query_processor'] = QueryProcessor()
|
63 |
SESSION_STORE['crawler'] = CustomCrawler(max_concurrent_requests=1000)
|
64 |
-
# SESSION_STORE['graph_rag'] = Neo4jGraphRAG(num_workers=os.cpu_count() * 2)
|
65 |
SESSION_STORE['graph_rag'] = GraphRAG(num_workers=os.cpu_count() * 2)
|
66 |
SESSION_STORE['evaluator'] = Evaluator()
|
67 |
SESSION_STORE['reasoner'] = Reasoner()
|
|
|
22 |
BUFFER = 10000
|
23 |
MAX_TOKENS_ALLOWED = CONTEXT_LENGTH - BUFFER
|
24 |
|
25 |
+
# Path to the .env file
|
26 |
+
ENV_FILE_PATH = os.getenv("WRITABLE_DIR", "/tmp") + "/.env"
|
27 |
+
|
28 |
# Per-session state
|
29 |
SESSION_STORE: Dict[str, Dict[str, Any]] = {}
|
30 |
|
|
|
47 |
|
48 |
# Initialize the components
|
49 |
def initialize_components():
|
50 |
+
load_dotenv(ENV_FILE_PATH, override=True)
|
51 |
|
52 |
from src.search.search_engine import SearchEngine
|
53 |
from src.query_processing.query_processor import QueryProcessor
|
|
|
54 |
from src.rag.graph_rag import GraphRAG
|
55 |
from src.evaluation.evaluator import Evaluator
|
56 |
from src.reasoning.reasoner import Reasoner
|
|
|
63 |
SESSION_STORE['search_engine'] = SearchEngine()
|
64 |
SESSION_STORE['query_processor'] = QueryProcessor()
|
65 |
SESSION_STORE['crawler'] = CustomCrawler(max_concurrent_requests=1000)
|
|
|
66 |
SESSION_STORE['graph_rag'] = GraphRAG(num_workers=os.cpu_count() * 2)
|
67 |
SESSION_STORE['evaluator'] = Evaluator()
|
68 |
SESSION_STORE['reasoner'] = Reasoner()
|