MCPcopy Create free account
hub / github.com/ZinYY/TreeLoRA / MovingAverage

Class MovingAverage

utils/utils.py:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30class MovingAverage:
31
32 def __init__(self):
33 self.count = 0
34 self.total = 0
35 self.mean = 0
36
37 def update(self, num):
38 self.total += num
39 self.count += 1
40 self.mean = self.total / self.count
41
42 return self.mean
43
44
45def load_hf_tokenizer(model_name_or_path, fast_tokenizer=True):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected