MCPcopy Create free account
hub / github.com/PAIR-code/lit / predict

Method predict

lit_nlp/components/static_preds.py:91–105  ·  view source on GitHub ↗

Predict on known inputs. Args: inputs: input examples **kw: unused Returns: predictions Raises: KeyError if input not recognized

(self, inputs: Iterable[JsonDict], **kw)

Source from the content-addressed store, hash-verified

89 return list(self.predict(inputs))
90
91 def predict(self, inputs: Iterable[JsonDict], **kw) -> Iterator[JsonDict]:
92 """Predict on known inputs.
93
94 Args:
95 inputs: input examples
96 **kw: unused
97
98 Returns:
99 predictions
100
101 Raises:
102 KeyError if input not recognized
103 """
104 # Implement predict() directly, since there's no need to batch.
105 return map(self._predict_single, inputs)

Callers 15

predict_minibatchMethod · 0.95
test_all_identifiersMethod · 0.95
annotateMethod · 0.45
generateMethod · 0.45
runMethod · 0.45
runMethod · 0.45
test_test_modelMethod · 0.45

Calls

no outgoing calls