starcoder

This commit is contained in:
Michael Yang 2023-10-02 19:52:25 -07:00
parent 1852755154
commit c02c0cd483
5 changed files with 32 additions and 7 deletions

View file

@ -1,7 +1,5 @@
package llm package llm
const ModelFamilyFalcon = "falcon"
const ( const (
falconModelType7B = 32 falconModelType7B = 32
falconModelType40B = 60 falconModelType40B = 60
@ -17,6 +15,6 @@ func falconModelType(numLayer uint32) string {
case 80: case 80:
return "180B" return "180B"
default: default:
return "Unknown" return "unknown"
} }
} }

View file

@ -69,7 +69,7 @@ func fileType(fileType uint32) string {
case fileTypeQ6_K: case fileTypeQ6_K:
return "Q6_K" return "Q6_K"
default: default:
return "Unknown" return "unknown"
} }
} }

View file

@ -109,9 +109,13 @@ func (llm *ggufModel) ModelType() string {
if blocks, ok := llm.kv["falcon.block_count"].(uint32); ok { if blocks, ok := llm.kv["falcon.block_count"].(uint32); ok {
return falconModelType(blocks) return falconModelType(blocks)
} }
case "starcoder":
if blocks, ok := llm.kv["starcoder.block_count"].(uint32); ok {
return starCoderModelType(blocks)
}
} }
return "Unknown" return "unknown"
} }
func (llm *ggufModel) FileType() string { func (llm *ggufModel) FileType() string {
@ -120,7 +124,7 @@ func (llm *ggufModel) FileType() string {
return fileType(t) return fileType(t)
} }
return "Unknown" return "unknown"
} }
func (llm *ggufModel) Decode(r io.Reader) error { func (llm *ggufModel) Decode(r io.Reader) error {

View file

@ -143,7 +143,7 @@ func llamaModelType(numLayer uint32) string {
case 80: case 80:
return "65B" return "65B"
default: default:
return "Unknown" return "unknown"
} }
} }

23
llm/starcoder.go Normal file
View file

@ -0,0 +1,23 @@
package llm
const (
starCoderModelType1B = 24
starCoderModelType3B = 36
starCoderModelType7B = 42
starCoderModelType15B = 40
)
func starCoderModelType(numLayer uint32) string {
switch numLayer {
case 24:
return "1B"
case 36:
return "3B"
case 42:
return "7B"
case 40:
return "15B"
default:
return "unknown"
}
}