File size: 947 Bytes
76562dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""CLI entry point for building the Chroma vector store from a curated dataset."""

import sys
from pathlib import Path
import argparse

sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))

from dealsight_intelligence.pricing.vectorstore import build_vectorstore


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Build the Chroma vector store from a pickled Item dataset.")
    parser.add_argument("--dataset-path", type=Path, default=None, help="Path to train_lite.pkl or train_full.pkl")
    parser.add_argument("--batch-size", type=int, default=1000, help="Chroma insert/upsert batch size")
    parser.add_argument("--reset", action="store_true", help="Delete and rebuild the products collection first")
    args = parser.parse_args()
    print(
        f"Built vector store at "
        f"{build_vectorstore(dataset_path=args.dataset_path, batch_size=args.batch_size, reset=args.reset)}"
    )