update embedded templates

This commit is contained in:
Michael Yang 2024-07-10 11:00:29 -07:00
parent 41be28096a
commit 19753c18c0
25 changed files with 74 additions and 60 deletions

View file

@ -3,6 +3,6 @@
{{- end }} {{- end }}
{{- range .Messages }}<start_{{ .Role }}>{{ .Content }}<end_message> {{- range .Messages }}<start_{{ .Role }}>{{ .Content }}<end_message>
{{- end }}<start_assistant> {{- end }}<start_assistant>
{{- else }} {{- else -}}
{{ if .System }}<start_system>{{ .System }}<end_message>{{ end }}{{ if .Prompt }}<start_user>{{ .Prompt }}<end_message>{{ end }}<start_assistant>{{ .Response }}<end_message> {{ if .System }}<start_system>{{ .System }}<end_message>{{ end }}{{ if .Prompt }}<start_user>{{ .Prompt }}<end_message>{{ end }}<start_assistant>{{ .Response }}<end_message>
{{- end }} {{- end -}}

View file

@ -1,6 +1,7 @@
{{- if .Messages }} {{- if .Messages }}
{{- if .System }}{{ .System }} {{- if .System }}{{ .System }}
{{- end }}
{{ end }}
{{- range .Messages }} {{- range .Messages }}
{{- if eq .Role "user" }}### Instruction: {{- if eq .Role "user" }}### Instruction:
{{- else if eq .Role "assistant" }}### Response: {{- else if eq .Role "assistant" }}### Response:
@ -8,7 +9,7 @@
{{ .Content }} {{ .Content }}
{{ end }}### Response: {{ end }}### Response:
{{ else }} {{ else -}}
{{ if .System }}{{ .System }} {{ if .System }}{{ .System }}
{{ end }}{{ if .Prompt }}### Instruction: {{ end }}{{ if .Prompt }}### Instruction:
@ -16,4 +17,5 @@
{{ end }}### Response: {{ end }}### Response:
{{ .Response }} {{ .Response }}
{{- end }}
{{ end -}}

View file

@ -5,11 +5,11 @@
{{- range .Messages }}<|im_start|>{{ .Role }} {{- range .Messages }}<|im_start|>{{ .Role }}
{{ .Content }}<|im_end|> {{ .Content }}<|im_end|>
{{ end }}<|im_start|>assistant {{ end }}<|im_start|>assistant
{{ else }} {{ else -}}
{{ if .System }}<|im_start|>system {{ if .System }}<|im_start|>system
{{ .System }}<|im_end|> {{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user {{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|> {{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant {{ end }}<|im_start|>assistant
{{ .Response }}<|im_end|> {{ .Response }}<|im_end|>
{{- end }} {{ end -}}

View file

@ -8,10 +8,11 @@
{{- end }} {{ .Content }} {{- end }} {{ .Content }}
{{ end }}Assistant: {{ end }}Assistant:
{{- else }} {{- else -}}
{{ if .System }}System: {{ .System }} {{ if .System }}System: {{ .System }}
{{ end }}{{ if .Prompt }}User: {{ .Prompt }} {{ end }}{{ if .Prompt }}User: {{ .Prompt }}
{{ end }}Assistant: <|begin_of_text|>{{ .Response }} {{ end }}Assistant: {{ .Response }}
{{- end }}
{{ end -}}

View file

@ -7,13 +7,13 @@
{{ .Content }} <step> {{ end }}Source: assistant {{ .Content }} <step> {{ end }}Source: assistant
Destination: user Destination: user
{{ else }} {{ else -}}
{{ if .System }} Source: system {{ if .System }}Source: system
{{ .System }} <step>{{ end }} Source: user {{ .System }} <step> {{ end }}Source: user
{{ .Prompt }} <step> Source: assistant {{ .Prompt }} <step> Source: assistant
Destination: user Destination: user
{{ .Response }}<step> {{ .Response }} <step>
{{- end }} {{- end -}}

View file

@ -6,8 +6,10 @@
{{ else if eq .Role "assistant" }}Falcon: {{ else if eq .Role "assistant" }}Falcon:
{{ end }}{{ .Content }} {{ end }}{{ .Content }}
{{ end }}Falcon: {{ end }}Falcon:
{{ else }} {{ else -}}
{{ if .System }}{{ .System }} {{ if .System }}System: {{ .System }}
{{ end }}{{ if .Prompt }}User: {{ .Prompt }} {{ end }}{{ if .Prompt }}User:
{{ end }}Assistant: {{ .Response }} {{ .Prompt }}
{{- end }} {{ end }}Falcon:
{{ .Response }}
{{ end -}}

View file

@ -8,9 +8,10 @@
{{- end }} {{- end }}
{{ .Content }}<end_of_turn> {{ .Content }}<end_of_turn>
{{ end }}<start_of_turn>model {{ end }}<start_of_turn>model
{{ else }} {{ else -}}
<start_of_turn>user <start_of_turn>user
{{ if .System }}{{ .System }} {{ end }}{{ .Prompt }}<end_of_turn> {{ if .System }}{{ .System }}
{{ end }}{{ .Prompt }}<end_of_turn>
<start_of_turn>model <start_of_turn>model
{{ .Response }}<end_of_turn> {{ .Response }}<end_of_turn>
{{- end }} {{ end -}}

View file

@ -10,9 +10,8 @@
{{ .Content }} {{ .Content }}
{{ end }}Answer: {{ end }}Answer:
{{ else }} {{ else -}}
{{ if .System }} {{ if .System }}System:
System:
{{ .System }} {{ .System }}
{{ end }}{{ if .Prompt }}Question: {{ end }}{{ if .Prompt }}Question:
@ -20,4 +19,5 @@ System:
{{ end }}Answer: {{ end }}Answer:
{{ .Response }} {{ .Response }}
{{- end }}
{{ end -}}

View file

@ -9,8 +9,8 @@
{{- else }} [/INST] {{ .Content }}</s><s> {{- else }} [/INST] {{ .Content }}</s><s>
{{- end }} {{- end }}
{{- end }} [/INST] {{- end }} [/INST]
{{- else }} {{- else -}}
[INST] <<SYS>>{{ .System }}<</SYS>> [INST] <<SYS>>{{ if .System }}{{ .System }}{{ end }}<</SYS>>
{{ .Prompt }} [/INST] {{ .Response }} {{ .Prompt }} [/INST] {{ .Response }}</s>
{{- end }} {{- end -}}

View file

@ -8,7 +8,7 @@
{{ .Content }}<|eot_id|> {{ .Content }}<|eot_id|>
{{- end }}<|start_header_id|>assistant<|end_header_id|> {{- end }}<|start_header_id|>assistant<|end_header_id|>
{{ else }} {{ else -}}
{{ if .System }}<|start_header_id|>system<|end_header_id|> {{ if .System }}<|start_header_id|>system<|end_header_id|>
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
@ -16,4 +16,4 @@
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
{{ .Response }}<|eot_id|> {{ .Response }}<|eot_id|>
{{- end }} {{- end -}}

View file

@ -9,7 +9,7 @@
{{ .Content }} {{ .Content }}
{{ end }}@@ Response {{ end }}@@ Response
{{ else }} {{ else -}}
{{ if .System }}{{ .System }} {{ if .System }}{{ .System }}
{{ end }}{{ if .Prompt }}@@ Instruction {{ end }}{{ if .Prompt }}@@ Instruction
@ -17,4 +17,5 @@
{{ end }}@@ Response {{ end }}@@ Response
{{ .Response }} {{ .Response }}
{{- end }}
{{ end -}}

View file

@ -5,5 +5,6 @@
{{- else if eq .Role "assistant" }}[/INST] {{ .Content }}</s> {{- else if eq .Role "assistant" }}[/INST] {{ .Content }}</s>
{{- end }} {{- end }}
{{- end }}[/INST] {{- end }}[/INST]
{{- else }}[INST] {{ if .System }}{{ .System }} {{ end }}{{ .Prompt }} [/INST] {{ .Response }} {{- else -}}
{{- end }} [INST] {{ if .System }}{{ .System }} {{ end }}{{ .Prompt }}[/INST] {{ .Response }}</s>
{{- end -}}

View file

@ -1,11 +1,11 @@
{{- if .Messages }} {{- if .Messages }}
{{- if .System }}GPT Correct System: {{ .System }}<|end_of_turn|> {{- if .System }}GPT4 Correct System: {{ .System }}<|end_of_turn|>
{{- end }} {{- end }}
{{- range .Messages }}GPT Correct {{- range .Messages }}GPT4 Correct
{{- if eq .Role "user" }} User: {{- if eq .Role "user" }} User:
{{- else if eq .Role "assistant" }} Assistant: {{- else if eq .Role "assistant" }} Assistant:
{{- end }} {{ .Content }}<|end_of_turn|> {{- end }} {{ .Content }}<|end_of_turn|>
{{- end }}GPT Correct Assistant: {{- end }}GPT4 Correct Assistant:
{{- else }} {{- else -}}
{{ .System }}<|end_of_turn|>GPT4 Correct User: {{ .Prompt }}<|end_of_turn|>GPT4 Correct Assistant: {{ .Response }}<|end_of_turn|> {{ if .System }}GPT4 Correct System: {{ .System }}<|end_of_turn|>{{ end }}GPT4 Correct User: {{ .Prompt }}<|end_of_turn|>GPT4 Correct Assistant: {{ .Response }}<|end_of_turn|>
{{- end }} {{- end -}}

View file

@ -5,11 +5,11 @@
{{- range .Messages }}<|{{ .Role }}|> {{- range .Messages }}<|{{ .Role }}|>
{{ .Content }}<|end|> {{ .Content }}<|end|>
{{ end }}<|assistant|> {{ end }}<|assistant|>
{{ else }} {{ else -}}
{{ if .System }}<|system|> {{ if .System }}<|system|>
{{ .System }}<|end|> {{ .System }}<|end|>
{{ end }}{{ if .Prompt }}<|user|> {{ end }}{{ if .Prompt }}<|user|>
{{ .Prompt }}<|end|> {{ .Prompt }}<|end|>
{{ end }}<|assistant|> {{ end }}<|assistant|>
{{ .Response }}<|end|> {{ .Response }}<|end|>
{{- end }} {{ end -}}

View file

@ -10,7 +10,7 @@
{{ .Content }}</s> {{ .Content }}</s>
{{ end }} {{ end }}
{{ end }}### Assistant: {{ end }}### Assistant:
{{ else }} {{ else -}}
{{ if .System }}### System: {{ if .System }}### System:
{{ .System }} {{ .System }}
@ -18,5 +18,6 @@
{{ .Prompt }} {{ .Prompt }}
{{ end }}### Assistant: {{ end }}### Assistant:
{{ .Response }} {{ .Response }}</s>
{{- end }}
{{ end -}}

View file

@ -11,14 +11,13 @@
{{ end }} {{ end }}
{{- end }}### Response {{- end }}### Response
{{ else }} {{ else -}}
{{ if .System }}{{ .System }} {{ if .System }}{{ .System }}
{{ end }}{{ if .Prompt }}### Instruction {{ end }}{{ if .Prompt }}### Instruction
{{ .Prompt }} {{ .Prompt }}
{{ end }}### Response {{ end }}### Response
{{ .Response }}<|endoftext|> {{ .Response }}<|endoftext|>
{{- end }} {{ end -}}

View file

@ -1,4 +1,6 @@
You are a helpful assistant.### Instruction: You are a helpful assistant.
### Instruction:
Hello, how are you? Hello, how are you?
### Response: ### Response:

View file

@ -9,3 +9,4 @@ Source: system
I'd like to show off how chat templating works! <step> Source: assistant I'd like to show off how chat templating works! <step> Source: assistant
Destination: user Destination: user

View file

@ -3,3 +3,4 @@ Source: user
Hello, how are you? <step> Source: assistant Hello, how are you? <step> Source: assistant
Destination: user Destination: user

View file

@ -7,3 +7,4 @@ Source: user
I'd like to show off how chat templating works! <step> Source: assistant I'd like to show off how chat templating works! <step> Source: assistant
Destination: user Destination: user

View file

@ -1 +1 @@
GPT Correct System: You are a helpful assistant.<|end_of_turn|>GPT Correct User: Hello, how are you?<|end_of_turn|>GPT Correct Assistant: I'm doing great. How can I help you today?<|end_of_turn|>GPT Correct User: I'd like to show off how chat templating works!<|end_of_turn|>GPT Correct Assistant: GPT4 Correct System: You are a helpful assistant.<|end_of_turn|>GPT4 Correct User: Hello, how are you?<|end_of_turn|>GPT4 Correct Assistant: I'm doing great. How can I help you today?<|end_of_turn|>GPT4 Correct User: I'd like to show off how chat templating works!<|end_of_turn|>GPT4 Correct Assistant:

View file

@ -1 +1 @@
GPT Correct User: Hello, how are you?<|end_of_turn|>GPT Correct Assistant: GPT4 Correct User: Hello, how are you?<|end_of_turn|>GPT4 Correct Assistant:

View file

@ -1 +1 @@
GPT Correct User: Hello, how are you?<|end_of_turn|>GPT Correct Assistant: I'm doing great. How can I help you today?<|end_of_turn|>GPT Correct User: I'd like to show off how chat templating works!<|end_of_turn|>GPT Correct Assistant: GPT4 Correct User: Hello, how are you?<|end_of_turn|>GPT4 Correct Assistant: I'm doing great. How can I help you today?<|end_of_turn|>GPT4 Correct User: I'd like to show off how chat templating works!<|end_of_turn|>GPT4 Correct Assistant:

View file

@ -7,8 +7,9 @@
{{ else if eq .Role "assistant" }}ASSISTANT: {{ .Content }}</s> {{ else if eq .Role "assistant" }}ASSISTANT: {{ .Content }}</s>
{{ end }} {{ end }}
{{- end }}ASSISTANT: {{- end }}ASSISTANT:
{{- else }} {{- else -}}
{{ if .System }}{{ .System }} {{ if .System }}{{ .System }}
{{ end }}{{ if .Prompt }}USER: {{ .Prompt }} {{ end }}{{ if .Prompt }}USER: {{ .Prompt }}
{{ end }}ASSISTANT: {{ .Response }} {{ end }}ASSISTANT: {{ .Response }}</s>
{{- end }} {{ end -}}

View file

@ -5,11 +5,11 @@
{{- range .Messages }}<|{{ .Role }}|> {{- range .Messages }}<|{{ .Role }}|>
{{ .Content }}</s> {{ .Content }}</s>
{{ end }}<|assistant|> {{ end }}<|assistant|>
{{ else }} {{ else -}}
{{ if .System }}<|system|> {{ if .System }}<|system|>
{{ .System }}</s> {{ .System }}</s>
{{ end }}{{ if .Prompt }}<|user|> {{ end }}{{ if .Prompt }}<|user|>
{{ .Prompt }}</s> {{ .Prompt }}</s>
{{ end }}<|assistant|> {{ end }}<|assistant|>
{{ .Response }}</s> {{ .Response }}</s>
{{- end }} {{ end -}}