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

Method multi_gpu_encode

src/flashrag/retriever/encoder.py:203–207  ·  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

201
202 @torch.inference_mode()
203 def multi_gpu_encode(self, query_list: Union[List[str], str], batch_size=64, is_query=True) -> np.ndarray:
204 if self.gpu_num > 1:
205 self.model = torch.nn.DataParallel(self.model)
206 query_emb = self.encode(query_list, batch_size, is_query)
207 return query_emb
208
209 @torch.inference_mode()
210 def encode_image(self, image_list: List) -> np.ndarray:

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected