(args=None)
| 14 | |
| 15 | |
| 16 | def main(args=None) -> None: |
| 17 | # 1. Load data |
| 18 | data = read_fvecs(args.data_file) |
| 19 | print(f"Data shape: {data.shape}") |
| 20 | |
| 21 | # 3. Build SymphonyQG index |
| 22 | n, dim = data.shape |
| 23 | print(f"\nBuilding SymphonyQG index: n={n}, dim={dim}, MaxDegree={args.max_degree}, " |
| 24 | f"ef={args.ef_construction}, metric={args.metric}") |
| 25 | |
| 26 | idx = SymqgIndex(dim=dim, max_degree=args.max_degree, metric=args.metric) |
| 27 | |
| 28 | t0 = time() |
| 29 | idx.build(data, ef_construction=args.ef_construction, num_threads=args.num_threads) |
| 30 | print(f"Indexing time: {time() - t0:.2f}s") |
| 31 | |
| 32 | idx.save(args.index_file) |
| 33 | print(f"Index saved → {args.index_file}") |
| 34 | |
| 35 | |
| 36 | if __name__ == "__main__": |
no test coverage detected