This commit is contained in:
Michael Yang 2023-11-29 10:54:23 -08:00
parent 72e7a49aa9
commit 5a5dca13b2

View file

@ -108,8 +108,7 @@ func (llm *ggufModel) NumKV() uint64 {
} }
func (llm *ggufModel) ModelFamily() string { func (llm *ggufModel) ModelFamily() string {
t, ok := llm.kv["general.architecture"].(string) if t, ok := llm.kv["general.architecture"].(string); ok {
if ok {
return t return t
} }
@ -146,8 +145,7 @@ func (llm *ggufModel) ModelType() string {
} }
func (llm *ggufModel) FileType() string { func (llm *ggufModel) FileType() string {
t, ok := llm.kv["general.file_type"].(uint32) if t, ok := llm.kv["general.file_type"].(uint32); ok {
if ok {
return fileType(t) return fileType(t)
} }
@ -216,6 +214,7 @@ func (llm *ggufModel) Decode(rso *readSeekOffset) error {
return err return err
} }
// dims is the number of dimensions in the tensor
dims := llm.readU32(rso) dims := llm.readU32(rso)
shape := [4]uint64{1, 1, 1, 1} shape := [4]uint64{1, 1, 1, 1}