Skip to content

Commit

Permalink
feat: models(gallery): add deepseek-v2-lite (#2658)
Browse files Browse the repository at this point in the history
* models(gallery): add deepseek-v2-lite

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* Update deepseek.yaml

The trailing space here is presumably part of the template string - try use a chomp keep to get yaml lint to accept it?

Signed-off-by: Dave <dave@gray101.com>

* Update deepseek.yaml

chomp didn't fix, erase the space and see what happens.

Signed-off-by: Dave <dave@gray101.com>

* Update deepseek.yaml

Signed-off-by: Dave <dave@gray101.com>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Dave <dave@gray101.com>
Co-authored-by: Dave <dave@gray101.com>
  • Loading branch information
mudler and dave-gray101 authored Jul 13, 2024
1 parent ce03541 commit b7c0d46
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/config/guesser.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
ChatML
Mistral03
Gemma
DeepSeek2
)

type settingsConfig struct {
Expand All @@ -37,6 +38,17 @@ var defaultsSettings map[familyType]settingsConfig = map[familyType]settingsConf
Completion: "{{.Input}}",
},
},
DeepSeek2: {
StopWords: []string{"<|end▁of▁sentence|>"},
TemplateConfig: TemplateConfig{
ChatMessage: `{{if eq .RoleName "user" -}}User: {{.Content }}
{{ end -}}
{{if eq .RoleName "assistant" -}}Assistant: {{.Content}}<|end▁of▁sentence|>{{end}}
{{if eq .RoleName "system" -}}{{.Content}}
{{end -}}`,
Chat: "{{.Input -}}\nAssistant: ",
},
},
LLaMa3: {
StopWords: []string{"<|eot_id|>"},
TemplateConfig: TemplateConfig{
Expand Down Expand Up @@ -208,8 +220,11 @@ func identifyFamily(f *gguf.GGUFFile) familyType {
qwen2 := arch == "qwen2"
phi3 := arch == "phi-3"
gemma := strings.HasPrefix(f.Model().Name, "gemma")
deepseek2 := arch == "deepseek2"

switch {
case deepseek2:
return DeepSeek2
case gemma:
return Gemma
case llama3:
Expand Down
20 changes: 20 additions & 0 deletions gallery/deepseek.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "deepseek"

config_file: |
mmap: true
context_size: 8192
template:
chat_message: |-
{{if eq .RoleName "user" -}}User: {{.Content }}
{{ end -}}
{{if eq .RoleName "assistant" -}}Assistant: {{.Content}}<|end▁of▁sentence|>{{end}}
{{if eq .RoleName "system" -}}{{.Content}}
{{end -}}
chat: |
{{.Input -}}
Assistant: # Space is preserved for templating reasons, but line does not end with one for the linter.
completion: |
{{.Input}}
stopwords:
- '<|end▁of▁sentence|>'
25 changes: 25 additions & 0 deletions gallery/index.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
---
## Deepseek
- &deepseek
url: "github:mudler/LocalAI/gallery/deepseek.yaml@master"
name: "deepseek-coder-v2-lite-instruct"
icon: "https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true"
license: deepseek
description: |
DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that achieves performance comparable to GPT4-Turbo in code-specific tasks. Specifically, DeepSeek-Coder-V2 is further pre-trained from DeepSeek-Coder-V2-Base with 6 trillion tokens sourced from a high-quality and multi-source corpus. Through this continued pre-training, DeepSeek-Coder-V2 substantially enhances the coding and mathematical reasoning capabilities of DeepSeek-Coder-V2-Base, while maintaining comparable performance in general language tasks. Compared to DeepSeek-Coder, DeepSeek-Coder-V2 demonstrates significant advancements in various aspects of code-related tasks, as well as reasoning and general capabilities. Additionally, DeepSeek-Coder-V2 expands its support for programming languages from 86 to 338, while extending the context length from 16K to 128K.
In standard benchmark evaluations, DeepSeek-Coder-V2 achieves superior performance compared to closed-source models such as GPT4-Turbo, Claude 3 Opus, and Gemini 1.5 Pro in coding and math benchmarks. The list of supported programming languages can be found in the paper.
urls:
- https://github.com/deepseek-ai/DeepSeek-Coder-V2/tree/main
- https://huggingface.co/LoneStriker/DeepSeek-Coder-V2-Lite-Instruct-GGUF
tags:
- llm
- gguf
- gpu
- deepseek
- cpu
overrides:
parameters:
model: DeepSeek-Coder-V2-Lite-Instruct-Q4_K_M.gguf
files:
- filename: DeepSeek-Coder-V2-Lite-Instruct-Q4_K_M.gguf
sha256: 50ec78036433265965ed1afd0667c00c71c12aa70bcf383be462cb8e159db6c0
uri: huggingface://LoneStriker/DeepSeek-Coder-V2-Lite-Instruct-GGUF/DeepSeek-Coder-V2-Lite-Instruct-Q4_K_M.gguf
## Start QWEN2
- &qwen2
url: "github:mudler/LocalAI/gallery/chatml.yaml@master"
Expand Down

0 comments on commit b7c0d46

Please sign in to comment.