MCPcopy Create free account
hub / github.com/InternScience/SciReason / get_logits

Method get_logits

opencompass/models/interntrain.py:447–453  ·  view source on GitHub ↗
(self, input_texts: Union[str, List[str]])

Source from the content-addressed store, hash-verified

445 return np.array(mink_percent)
446
447 def get_logits(self, input_texts: Union[str, List[str]]):
448 tokens = self.batch_encode(input_texts, max_seq_len=self.max_seq_len)
449 outputs = self.model(input_ids=tokens)
450 if isinstance(outputs, tuple):
451 # moe returns (hidden_states, moe_losses)
452 outputs = outputs[0]
453 return outputs, tokens
454
455 def batch_encode(self,
456 input_texts: Union[str, List[str]],

Callers 3

get_pplMethod · 0.95
get_loglikelihoodMethod · 0.95
get_mink_percentMethod · 0.95

Calls 1

batch_encodeMethod · 0.95

Tested by

no test coverage detected