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

Method _validate_ids

lit_nlp/lib/caching.py:240–248  ·  view source on GitHub ↗
(self, inputs: Iterable[JsonDict])

Source from the content-addressed store, hash-verified

238 return (self._name, d_id) if (d_id := d.get("_id")) else None
239
240 def _validate_ids(self, inputs: Iterable[JsonDict]):
241 for ex in inputs:
242 if not (given_id := ex.get("_id")):
243 continue
244 if (computed_id := self._id_hash_fn(types.Input(ex))) != given_id:
245 raise ValueError(
246 f"Given id '{given_id}' does not match computed id '{computed_id}'"
247 f" for example {str(ex)}."
248 )
249
250 ##
251 # For internal use

Callers 1

predictMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected