diff options
| author | CHEN SHENGYUAN <chenshengyuan@CHENdeMacBook-Air.local> | 2025-12-18 15:35:33 +0800 |
|---|---|---|
| committer | CHEN SHENGYUAN <chenshengyuan@CHENdeMacBook-Air.local> | 2025-12-18 15:35:33 +0800 |
| commit | 7a4ad471c9026c7882504b1c8b730045b4bb74af (patch) | |
| tree | 863a1be06e96de2b96452a2691f93804510d1f38 /run.py | |
| parent | f70419cda9ea442ed3e965fcd3b2b4035f124308 (diff) | |
enable vectorized retrieval with sparse matrix operations
Diffstat (limited to 'run.py')
| -rw-r--r-- | run.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -25,6 +25,7 @@ def parse_arguments(): parser.add_argument("--iteration_threshold", type=float, default=0.4, help="The threshold for iteration") parser.add_argument("--passage_ratio", type=float, default=2, help="The ratio for passage") parser.add_argument("--top_k_sentence", type=int, default=3, help="The top k sentence to use") + parser.add_argument("--use_vectorized_retrieval", action="store_true", help="Use vectorized matrix-based retrieval instead of BFS iteration") return parser.parse_args() @@ -59,7 +60,8 @@ def main(): max_iterations=args.max_iterations, iteration_threshold=args.iteration_threshold, passage_ratio=args.passage_ratio, - top_k_sentence=args.top_k_sentence + top_k_sentence=args.top_k_sentence, + use_vectorized_retrieval=args.use_vectorized_retrieval ) rag_model = LinearRAG(global_config=config) rag_model.index(passages) |
