model: Load tensors behind an interface

Currently, if a model uses an interface for its data structures (as mllama
does) then the tensor data in the structs implementing that interface will
not get loaded.
This commit is contained in:
Jesse Gross
2025-01-14 16:12:14 -08:00
committed by Jesse Gross
parent d223f3b697
commit d650ad398f
2 changed files with 31 additions and 16 deletions

View File

@@ -90,7 +90,7 @@ func TestPopulateFields(t *testing.T) {
"output_norm.weight",
"output.weight",
},
}, v))
}, v.Elem()))
if diff := cmp.Diff(fakeModel{
Input: &nn.Embedding{Weight: &fakeTensor{Name: "input.weight"}},
@@ -125,7 +125,7 @@ func TestPopulateFieldsAlternateName(t *testing.T) {
names: []string{
"input.weight",
},
}, v))
}, v.Elem()))
if diff := cmp.Diff(fakeModel{
Input: &nn.Embedding{Weight: &fakeTensor{Name: "input.weight"}},