Oviya commited on
Commit
0dc5a09
·
1 Parent(s): 6665ae7
Files changed (2) hide show
  1. ragg/ingest_all.py +1 -1
  2. ragg/ingest_trigger.py +4 -2
ragg/ingest_all.py CHANGED
@@ -1,6 +1,6 @@
1
  # ingest_all.py
2
  import os
3
- from rag_backend import ingest_pdfs_from_folder, get_embeddings
4
  from langchain_community.vectorstores import Chroma
5
 
6
  def ingest_all_levels():
 
1
  # ingest_all.py
2
  import os
3
+ from ragg.rag_backend import ingest_pdfs_from_folder, get_embeddings
4
  from langchain_community.vectorstores import Chroma
5
 
6
  def ingest_all_levels():
ragg/ingest_trigger.py CHANGED
@@ -16,9 +16,11 @@ def run_ingest():
16
  print(f"🔹 Running ingestion script: {script_path}")
17
 
18
  result = subprocess.run(
19
- [sys.executable, script_path],
20
  capture_output=True,
21
- text=True
 
 
22
  )
23
 
24
  return jsonify({
 
16
  print(f"🔹 Running ingestion script: {script_path}")
17
 
18
  result = subprocess.run(
19
+ [sys.executable, "-m", "rag.ingest_all"], # <-- run as package module
20
  capture_output=True,
21
+ text=True,
22
+ cwd=None,
23
+ timeout=int(os.getenv("INGEST_TIMEOUT_SEC", "1800"))
24
  )
25
 
26
  return jsonify({