MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / update

Method update

codegeex/mindspore/src/metrics.py:45–51  ·  view source on GitHub ↗

Update list of ppl

(self, *inputs)

Source from the content-addressed store, hash-verified

43 self.tokens_count = 0
44
45 def update(self, *inputs): # inputs
46 """Update list of ppl"""
47 if not self.is_last_stage:
48 return
49 logits = inputs[0].asnumpy().flatten().tolist() # logits
50 self.PPL.append(logits[0] * self.data_length)
51 self.tokens_count += 1
52
53 def eval(self):
54 if not self.is_last_stage:

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected