MCPcopy Create free account
hub / github.com/AI-Hypercomputer/maxtext / _split_dpo_state

Function _split_dpo_state

src/MaxText/dpo_utils.py:25–29  ·  view source on GitHub ↗

Split DPO state to separate reference parameters.

(state)

Source from the content-addressed store, hash-verified

23
24
25def _split_dpo_state(state):
26 """Split DPO state to separate reference parameters."""
27 reference_params = state.params["reference_params"]
28 new_state = state.replace(params={k: v for k, v in state.params.items() if k != "reference_params"})
29 return new_state, reference_params
30
31
32def dpo_loss_fn(model, config, data, dropout_rng, params, reference_params, is_train=True):

Callers 3

train_stepFunction · 0.90
eval_stepFunction · 0.90
train_loopFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected