Download experiments/msmarco_scale/bench_fast.py from Angshul/SparseGeometricRAG: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/datasets/Angshul/SparseGeometricRAG/resolve/main/experiments/msmarco_scale/bench_fast.py
- Command line
-
hf download hf://datasets/Angshul/SparseGeometricRAG/experiments/msmarco_scale/bench_fast.py
-
curl -L -o bench_fast.py https://huggingface.co/datasets/Angshul/SparseGeometricRAG/resolve/main/experiments/msmarco_scale/bench_fast.py
436 Bytes
| import sys,time | |
| sys.path.insert(0,'/mnt/data') | |
| from msmarco_full_search_fast import FullIndex,load_query_texts | |
| ids=['300674','125705','94798','9083','174249']; txt=load_query_texts(ids); idx=FullIndex(); print('loaded') | |
| for rep in range(2): | |
| for q in ids: | |
| t=time.perf_counter(); p=idx.prepare(txt[q],20); r=idx.rank_h(p,0,100); print(rep,q,(time.perf_counter()-t)*1000,p['candidate_memberships'],p['candidate_docs'],r[:5],flush=True) | |