MCPcopy Create free account
hub / github.com/Agent-RL/ReCall / multi_gpu_encode

Method multi_gpu_encode

src/flashrag/retriever/encoder.py:79–83  ·  view source on GitHub ↗
(self, query_list: Union[List[str], str], batch_size=64, is_query=True)

Source from the content-addressed store, hash-verified

77
78 @torch.inference_mode()
79 def multi_gpu_encode(self, query_list: Union[List[str], str], batch_size=64, is_query=True) -> np.ndarray:
80 if self.gpu_num > 1:
81 self.model = torch.nn.DataParallel(self.model)
82 query_emb = self.encode(query_list, batch_size, is_query)
83 return query_emb
84
85
86class STEncoder:

Callers 2

encode_allMethod · 0.45
encode_all_clipMethod · 0.45

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected