mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
Add patch_mixtral_replace_moe_impl for full training Mitral using DeepSpeed Zero3.
Signed-off-by: ldwang <ftgreat@gmail.com> Former-commit-id: 5f50c02f0e425737cd80abdf8fde9e25abf13083
This commit is contained in:
parent
36ac14a566
commit
786a2f1103
@ -269,6 +269,7 @@ def patch_config(
|
||||
|
||||
|
||||
def patch_mixtral_replace_moe_impl() -> None:
|
||||
import torch.nn.functional as F
|
||||
def mlp_forward(self, hidden_states):
|
||||
current_hidden_states = self.act_fn(self.w1(hidden_states)) * self.w3(hidden_states)
|
||||
current_hidden_states = self.w2(current_hidden_states)
|
||||
|
Loading…
x
Reference in New Issue
Block a user