Spaces:
Sleeping
Sleeping
Commit
·
9c70634
1
Parent(s):
a9725a0
all path issue fixed
Browse files- 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 |
-
|
6 |
-
|
|
|
7 |
collection = client.get_or_create_collection(name="yt_transcript_collection")
|
8 |
-
|
9 |
-
|
|
|
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
|