MCPcopy Create free account
hub / github.com/microsoft/BitNet / get_ppl_value

Method get_ppl_value

utils/test_perplexity.py:502–511  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

500 if successful:
501 # Extract numeric value from "mean±std" format for sorting
502 def get_ppl_value(result):
503 ppl = result['perplexity']
504 if isinstance(ppl, str) and '±' in ppl:
505 return float(ppl.split('±')[0])
506 elif isinstance(ppl, str):
507 try:
508 return float(ppl)
509 except ValueError:
510 return float('inf')
511 return ppl
512
513 successful_sorted = sorted(successful, key=get_ppl_value)
514

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected