"vscode:/vscode.git/clone" did not exist on "6a7f1f09657fbf0f26acd3b774d1945286b64aca"
Unverified Commit 33801c15 authored by Grace's avatar Grace Committed by GitHub
Browse files

Fixed Deepseek2 adding nil tensor error

parent e4340667
...@@ -150,7 +150,9 @@ func (moe *sparse) Moe(ctx ml.Context, hiddenStates, topKIndices, topKWeights ml ...@@ -150,7 +150,9 @@ func (moe *sparse) Moe(ctx ml.Context, hiddenStates, topKIndices, topKWeights ml
} }
func (moe *sparse) topKIndices(ctx ml.Context, scores ml.Tensor, opts *Options) ml.Tensor { func (moe *sparse) topKIndices(ctx ml.Context, scores ml.Tensor, opts *Options) ml.Tensor {
if moe.ExpProbsBias != nil {
scores = scores.Add(ctx, moe.ExpProbsBias) scores = scores.Add(ctx, moe.ExpProbsBias)
}
topKIndices := scores.TopK(ctx, opts.numExpertsUsed) topKIndices := scores.TopK(ctx, opts.numExpertsUsed)
return topKIndices return topKIndices
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment