← Về thư mục
search_r1/search/index_builder.py
- load_model · function · L17-L29 — def load_model( model_path: str, use_fp16: bool = False )
- pooling · function · L32-L46 — def pooling( pooler_output, last_hidden_state, attention_mask = None, pooling_method = "mean" )
- load_corpus · function · L49-L55 — def load_corpus(corpus_path: str)
- Index_Builder · class · L58-L285 — class Index_Builder
- init · method · L62-L106 — def init( self, retrieval_method, model_path, corpus_path, save_dir, max_length, batch_size, use_fp16, pooling_method, faiss_type=None, embedding_path=None, save_embedding=False, faiss_gpu=False )
- _check_dir · method · L108-L118 — def _check_dir(dir_path)
- build_index · method · L120-L127 — def build_index(self)
- build_bm25_index · method · L129-L161 — def build_bm25_index(self)
- _load_embedding · method · L163-L169 — def _load_embedding(self, embedding_path, corpus_size, hidden_size)
- _save_embedding · method · L171-L186 — def _save_embedding(self, all_embeddings)
- encode_all · method · L188-L242 — def encode_all(self)
- build_dense_index · method · L245-L285 — def build_dense_index(self)
- main · function · L296-L344 — def main()