MCPcopy Create free account
hub / github.com/eric-mitchell/direct-preference-optimization / formatted_dict

Function formatted_dict

utils.py:94–96  ·  view source on GitHub ↗

Format a dictionary for printing.

(d: Dict)

Source from the content-addressed store, hash-verified

92
93
94def formatted_dict(d: Dict) -> Dict:
95 """Format a dictionary for printing."""
96 return {k: (f"{v:.5g}" if type(v) == float else v) for k, v in d.items()}
97
98
99def disable_dropout(model: torch.nn.Module):

Callers 1

trainMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected