MCPcopy Create free account
hub / github.com/CERT-Lab/lora-sb / format_params

Function format_params

utils/misc.py:5–9  ·  view source on GitHub ↗

Format parameter count in terms of K (1000)

(num: int)

Source from the content-addressed store, hash-verified

3from typing import Dict, Tuple
4
5def format_params(num: int) -> str:
6 """Format parameter count in terms of K (1000)"""
7 if num >= 1000:
8 return f"{num/1000:.2f}K"
9 return str(num)
10
11def count_parameters(model: nn.Module, verbose: bool = False) -> Dict[str, float]:
12 """

Callers 1

count_parametersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected