mirror of
https://github.com/zebrajr/ollama.git
synced 2025-12-06 12:19:56 +01:00
Fixed Deepseek2 adding nil tensor error
This commit is contained in:
parent
e4340667e3
commit
33801c1597
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user