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

Function disable_dropout

utils.py:99–103  ·  view source on GitHub ↗

Disable dropout in a model.

(model: torch.nn.Module)

Source from the content-addressed store, hash-verified

97
98
99def disable_dropout(model: torch.nn.Module):
100 """Disable dropout in a model."""
101 for module in model.modules():
102 if isinstance(module, torch.nn.Dropout):
103 module.p = 0
104
105
106def print_gpu_memory(rank: int = None, message: str = ''):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected