-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModelfile-mistral
69 lines (57 loc) · 1.87 KB
/
Modelfile-mistral
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# ollama create mistral-nemo-2407:q6_k_l -f modelfiles/Modelfile-mistral
# ollama create mistral-large-instruct-2411:iq2_m -f modelfiles/Modelfile-mistral
FROM ../Mistral-Large-Instruct-2411-IQ2_M.gguf
TEMPLATE """
{{- if .Messages }}
{{- range $index, $_ := .Messages }}
{{- if eq .Role "user" }}
{{- if and (le (len (slice $.Messages $index)) 2) $.Tools }}[AVAILABLE_TOOLS] {{ $.Tools }}[/AVAILABLE_TOOLS]
{{- end }}[INST] {{ if and $.System (eq (len (slice $.Messages $index)) 1) }}{{ $.System }}
{{ end }}{{ .Content }}[/INST]
{{- else if eq .Role "assistant" }}
{{- if .Content }} {{ .Content }}
{{- if not (eq (len (slice $.Messages $index)) 1) }}</s>
{{- end }}
{{- else if .ToolCalls }}[TOOL_CALLS] [
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}]</s>
{{- end }}
{{- else if eq .Role "tool" }}[TOOL_RESULTS] {"content": {{ .Content }}}[/TOOL_RESULTS]
{{- end }}
{{- end }}
{{- else }}[INST] {{ if .System }}{{ .System }}
{{ end }}{{ .Prompt }}[/INST]
{{- end }}
{{ if .Response }} {{ end }}{{ .Response }}
{{- if .Response }}</s>
{{- end }}
"""
PARAMETER stop [INST]
PARAMETER stop [/INST]
PARAMETER stop </s>
### Tuning ##
# PARAMETER num_batch 1024
# PARAMETER num_batch 1024
# PARAMETER num_ctx 8192
# PARAMETER num_ctx 24572
# PARAMETER num_ctx 16384
PARAMETER num_ctx 16384
# PARAMETER temperature 0.2
# PARAMETER top_p 0.8
### min_p sampling ##
# min_p works best with a bit of temperature
PARAMETER temperature 0.2
# 1.0 disables top_p, so we can use min_p
PARAMETER top_p 1.0
PARAMETER min_p 0.9
### min_p sampling ##
# fit mistral large
PARAMETER num_batch 64
## For codegen ##
# PARAMETER num_keep 512
# PARAMETER top_p 0.8 # default
# PARAMETER top_k 20 # default
# PARAMETER repetition_penalty 1.05 # default
# PARAMETER presence_penalty 0.2
# PARAMETER frequency_penalty 0.2
# PARAMETER repeat_last_n 50