MCPcopy Create free account
hub / github.com/Cornell-RelaxML/qtip / validate

Method validate

model/cache_utils.py:313–337  ·  view source on GitHub ↗

Validates if the arguments passed are correct

(self)

Source from the content-addressed store, hash-verified

311 self.device = device
312
313 def validate(self):
314 """Validates if the arguments passed are correct"""
315
316 incorrect_arg_msg = (
317 "Some of the keys in `cache_config` are defined incorrectly. `{key}` should be {correct_value}` "
318 "but found {found_value}"
319 )
320
321 if self.batch_size <= 0:
322 raise ValueError(
323 incorrect_arg_msg.format(
324 key="batch_size",
325 correct_value="> 0",
326 found_value=self.batch_size,
327 ),
328 )
329
330 if self.max_cache_len <= 0:
331 raise ValueError(
332 incorrect_arg_msg.format(
333 key="max_cache_len",
334 correct_value="> 0",
335 found_value=self.max_cache_len,
336 ),
337 )
338
339
340class DynamicCache(Cache):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected