mirror of
https://github.com/ollama/ollama.git
synced 2025-04-21 22:15:04 +02:00
tensor loading iface
This commit is contained in:
parent
9722d96db2
commit
a34960a516
@ -152,6 +152,12 @@ func New(s string) (Model, error) {
|
||||
}
|
||||
|
||||
func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
||||
var iface bool
|
||||
if v.Kind() == reflect.Interface {
|
||||
iface = true
|
||||
v = v.Elem()
|
||||
}
|
||||
|
||||
t := v.Type()
|
||||
if t.Kind() == reflect.Pointer {
|
||||
t, v = t.Elem(), v.Elem()
|
||||
@ -230,6 +236,10 @@ func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
||||
}
|
||||
}
|
||||
|
||||
if iface {
|
||||
return v.Addr()
|
||||
}
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user