From 56ffc3023a6a7ad3715f7d04f1ebde7034781598 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 8 Dec 2023 16:39:26 -0800 Subject: [PATCH] remove per-model types mostly replaced by decoding tensors except ggml models which only support llama --- llm/falcon.go | 20 -------------------- llm/gguf.go | 21 --------------------- llm/starcoder.go | 23 ----------------------- 3 files changed, 64 deletions(-) delete mode 100644 llm/falcon.go delete mode 100644 llm/starcoder.go diff --git a/llm/falcon.go b/llm/falcon.go deleted file mode 100644 index d45eb9ef..00000000 --- a/llm/falcon.go +++ /dev/null @@ -1,20 +0,0 @@ -package llm - -const ( - falconModelType7B = 32 - falconModelType40B = 60 - falconModelType180B = 80 -) - -func falconModelType(numLayer uint32) string { - switch numLayer { - case 32: - return "7B" - case 60: - return "40B" - case 80: - return "180B" - default: - return "unknown" - } -} diff --git a/llm/gguf.go b/llm/gguf.go index 29270e51..d92932c5 100644 --- a/llm/gguf.go +++ b/llm/gguf.go @@ -120,27 +120,6 @@ func (llm *ggufModel) ModelType() string { return format.HumanNumber(llm.parameters) } - switch llm.ModelFamily() { - case "llama": - if blocks, ok := llm.kv["llama.block_count"].(uint32); ok { - heads, headsOK := llm.kv["llama.head_count"].(uint32) - headKVs, headsKVsOK := llm.kv["llama.head_count_kv"].(uint32) - if headsOK && headsKVsOK && heads/headKVs == 8 { - return "70B" - } - - return llamaModelType(blocks) - } - case "falcon": - 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" } diff --git a/llm/starcoder.go b/llm/starcoder.go deleted file mode 100644 index 00fc51bc..00000000 --- a/llm/starcoder.go +++ /dev/null @@ -1,23 +0,0 @@ -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" - } -}