Merge pull request #686 from jmorganca/mxyng/starcoder
decode starcoder
This commit is contained in:
commit
367cb68dc1
5 changed files with 32 additions and 7 deletions
|
@ -1,7 +1,5 @@
|
|||
package llm
|
||||
|
||||
const ModelFamilyFalcon = "falcon"
|
||||
|
||||
const (
|
||||
falconModelType7B = 32
|
||||
falconModelType40B = 60
|
||||
|
@ -17,6 +15,6 @@ func falconModelType(numLayer uint32) string {
|
|||
case 80:
|
||||
return "180B"
|
||||
default:
|
||||
return "Unknown"
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ func fileType(fileType uint32) string {
|
|||
case fileTypeQ6_K:
|
||||
return "Q6_K"
|
||||
default:
|
||||
return "Unknown"
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,9 +109,13 @@ func (llm *ggufModel) ModelType() string {
|
|||
if blocks, ok := llm.kv["falcon.block_count"].(uint32); ok {
|
||||
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 {
|
||||
|
@ -120,7 +124,7 @@ func (llm *ggufModel) FileType() string {
|
|||
return fileType(t)
|
||||
}
|
||||
|
||||
return "Unknown"
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func (llm *ggufModel) Decode(r io.Reader) error {
|
||||
|
|
|
@ -143,7 +143,7 @@ func llamaModelType(numLayer uint32) string {
|
|||
case 80:
|
||||
return "65B"
|
||||
default:
|
||||
return "Unknown"
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
23
llm/starcoder.go
Normal file
23
llm/starcoder.go
Normal 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"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue