MCPcopy Create free account
hub / github.com/DataArcTech/DataArc-SynData-Toolkit / add_progress

Method add_progress

sdgsystem/buffer.py:47–56  ·  view source on GitHub ↗

Add current progress to buffer Args: idxs: The index of processed sample added after the last save.

(self, idxs: List[int])

Source from the content-addressed store, hash-verified

45 self.usage["total"] = total
46
47 def add_progress(self, idxs: List[int]):
48 """
49 Add current progress to buffer
50 Args:
51 idxs: The index of processed sample added after the last save.
52 """
53 with self._lock:
54 if max(idxs) >= self.usage["total"]:
55 raise Exception(f"Error occurred when add progress to buffer: {idxs} to be added >= total={self.usage['total']}")
56 self.tmp_add_progress.extend(idxs)
57
58 def load(self, usage_counter: ModelUsageCounter = None) -> Iterable[Any]:
59 # save the original total from __init__ before loading

Callers 6

rewriteMethod · 0.95
generateMethod · 0.95
generateMethod · 0.95
generateMethod · 0.95
executeMethod · 0.80
_validate_samplesMethod · 0.80

Calls 1

extendMethod · 0.80

Tested by

no test coverage detected