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

Method query_emb

src/retrieval/server.py:39–44  ·  view source on GitHub ↗
(self, input_ids, attention_mask)

Source from the content-addressed store, hash-verified

37 module.weight.data.normal_(mean=0.0, std=0.02)
38
39 def query_emb(self, input_ids, attention_mask):
40 outputs1 = self.roberta(input_ids=input_ids, attention_mask=attention_mask)
41 outputs1 = outputs1.last_hidden_state
42 full_emb = self.masked_mean_or_first(outputs1, attention_mask)
43 query1 = self.norm(self.embeddingHead(full_emb))
44 return query1
45
46 def doc_emb(self, input_ids, attention_mask):
47 return self.query_emb(input_ids, attention_mask)

Callers 2

doc_embMethod · 0.95
forwardMethod · 0.95

Calls 1

masked_mean_or_firstMethod · 0.95

Tested by

no test coverage detected