fix layer norm name in PPO

Former-commit-id: 3ffc2efb997b717b3efad92a507584276e4bdfa1
This commit is contained in:
hiyouga 2023-06-02 17:30:01 +08:00
parent 58c8b29913
commit 09997a25d3

View File

@ -41,7 +41,7 @@ def replace_model(model: AutoModelForCausalLMWithValueHead, target: Literal["def
def cast_layernorm_dtype(
model: AutoModelForCausalLMWithValueHead,
layer_norm_names: List[str] = ["layernorm"], # for chatglm setting
layer_norm_names: List[str] = ["norm", "ln_f"], # for LLaMA and BLOOM setting
layer_norm_params: Optional[Dict[str, torch.Tensor]] = None
) -> Tuple[AutoModelForCausalLMWithValueHead, Dict[str, torch.Tensor]]: