mirror of
https://github.com/zebrajr/ollama.git
synced 2025-12-06 12:19:56 +01:00
fix: nil pointer dereference if cache is nil (#12215)
This commit is contained in:
parent
4378ae4ffa
commit
9714e38dd0
|
|
@ -70,11 +70,9 @@ func kvCacheTypeFromStr(s string) ml.DType {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *InputCache) Close() {
|
func (c *InputCache) Close() {
|
||||||
if c == nil {
|
if c != nil && c.cache != nil {
|
||||||
return
|
c.cache.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
c.cache.Close()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Locking: Operations on InputCacheSlot (including finding one
|
// Locking: Operations on InputCacheSlot (including finding one
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user