mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 04:14:38 +08:00
Fix lora for qwen moe (#743)
* fix lora for qwen moe * use max seq length in test as well
This commit is contained in:
@@ -141,7 +141,7 @@ class Qwen2MoeSparseMoeBlock(nn.Module):
|
||||
|
||||
if self.training:
|
||||
inds = np.array(inds)
|
||||
y = mx.zeros((B, ne, D), x.dtype)
|
||||
y = mx.zeros((B * L, ne, D), x.dtype)
|
||||
for e, expert in enumerate(self.experts):
|
||||
idx1, idx2 = map(mx.array, np.where(inds == e))
|
||||
if idx1.size == 0:
|
||||
|
Reference in New Issue
Block a user