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

Method query_emb

index/dense/models.py:35–41  ·  view source on GitHub ↗
(self, input_ids, attention_mask)

Source from the content-addressed store, hash-verified

33 module.weight.data.normal_(mean=0.0, std=0.02)
34
35 def query_emb(self, input_ids, attention_mask):
36 outputs1 = self.roberta(input_ids=input_ids,
37 attention_mask=attention_mask)
38 outputs1 = outputs1.last_hidden_state
39 full_emb = self.masked_mean_or_first(outputs1, attention_mask)
40 query1 = self.norm(self.embeddingHead(full_emb))
41 return query1
42
43
44 def doc_emb(self, 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