MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / load_model

Function load_model

src/retrieval/server.py:64–74  ·  view source on GitHub ↗
(model_path: str)

Source from the content-addressed store, hash-verified

62
63########################### utils start #############################
64def load_model(model_path: str):
65 config = RobertaConfig.from_pretrained(
66 model_path,
67 finetuning_task="MSMarco",
68 )
69 tokenizer = RobertaTokenizer.from_pretrained(
70 model_path,
71 do_lower_case=True
72 )
73 model = ANCE.from_pretrained(model_path, config=config).to('cuda')
74 return tokenizer, model
75
76def build_faiss_index(index_path: str, n_gpu: int, faiss_gpu: bool=True):
77 gpu_resources = []

Callers 1

__init__Method · 0.70

Calls 2

from_pretrainedMethod · 0.80
toMethod · 0.80

Tested by

no test coverage detected