MCPcopy Create free account
hub / github.com/csuhan/OneLLM / __init__

Method __init__

util/misc.py:44–50  ·  view source on GitHub ↗
(self, window_size=20, fmt=None)

Source from the content-addressed store, hash-verified

42 """
43
44 def __init__(self, window_size=20, fmt=None):
45 if fmt is None:
46 fmt = "{median:.4f} ({global_avg:.4f})"
47 self.deque = deque(maxlen=window_size)
48 self.total = 0.0
49 self.count = 0
50 self.fmt = fmt
51
52 def update(self, value, n=1):
53 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected