Spaces:
Runtime error
Runtime error
Commit
·
b1dd939
1
Parent(s):
ae1af74
Upload 2 files
Browse files- Example/__init__.py +0 -0
- Example/rag_example.py +18 -0
Example/__init__.py
ADDED
|
File without changes
|
Example/rag_example.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 17 |
+
if __name__ == "__main__":
|
| 18 |
+
main_workflow(transcripts_folder_path, collection)
|