Nightwing11 commited on
Commit
9c70634
·
1 Parent(s): a9725a0

all path issue fixed

Browse files
Files changed (1) hide show
  1. Example/rag_example.py +9 -5
Example/rag_example.py CHANGED
@@ -1,12 +1,16 @@
1
  import sys
2
  import chromadb
 
 
3
  # transcripts_folder_path = '/home/nightwing/Codes/Xyzbot/Data/transcripts'
4
- transcripts_folder_path = 'Data/transcripts'
5
- chromadb_path = "Rag/chromadb.db"
6
- client = chromadb.PersistentClient(path=chromadb_path)
 
7
  collection = client.get_or_create_collection(name="yt_transcript_collection")
8
-
9
- print("Python path:", sys.path)
 
10
  from Rag.rag_pipeline import main_workflow
11
 
12
  # Run the application
 
1
  import sys
2
  import chromadb
3
+ from pathlib import Path
4
+ PROJECT_ROOT = Path(__file__).resolve().parent.parent
5
  # transcripts_folder_path = '/home/nightwing/Codes/Xyzbot/Data/transcripts'
6
+ # transcripts_folder_path = 'Data/transcripts'
7
+ transcripts_folder_path = PROJECT_ROOT / "Data" / "transcripts"
8
+ chromadb_path = PROJECT_ROOT / "Rag" / "chromadb.db"
9
+ client = chromadb.PersistentClient(path=str(chromadb_path))
10
  collection = client.get_or_create_collection(name="yt_transcript_collection")
11
+ sys.path.append(str(PROJECT_ROOT))
12
+ sys.path.append(str(PROJECT_ROOT / "Rag"))
13
+ # print("Python path:", sys.path)
14
  from Rag.rag_pipeline import main_workflow
15
 
16
  # Run the application