mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 07:46:59 +00:00
embed templates
This commit is contained in:
committed by
Jeffrey Morgan
parent
39f4d8edaa
commit
9b8a456c7d
@@ -1,6 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -19,7 +20,9 @@ import (
|
||||
"github.com/jmorganca/ollama/llama"
|
||||
)
|
||||
|
||||
var templates = template.Must(template.ParseGlob("templates/*.prompt"))
|
||||
//go:embed templates/*
|
||||
var templatesFS embed.FS
|
||||
var templates = template.Must(template.ParseFS(templatesFS, "templates/*.prompt"))
|
||||
|
||||
func generate(c *gin.Context) {
|
||||
// TODO: these should be request parameters
|
||||
|
||||
8
server/templates/alpaca.prompt
Normal file
8
server/templates/alpaca.prompt
Normal file
@@ -0,0 +1,8 @@
|
||||
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
||||
|
||||
### Instruction:
|
||||
{{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
|
||||
|
||||
3
server/templates/falcon.prompt
Normal file
3
server/templates/falcon.prompt
Normal file
@@ -0,0 +1,3 @@
|
||||
A helpful assistant who helps the user with any questions asked.
|
||||
User: {{ .Prompt }}
|
||||
Assistant:
|
||||
5
server/templates/gpt4.prompt
Normal file
5
server/templates/gpt4.prompt
Normal file
@@ -0,0 +1,5 @@
|
||||
### Instruction:
|
||||
{{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
|
||||
5
server/templates/hermes.prompt
Normal file
5
server/templates/hermes.prompt
Normal file
@@ -0,0 +1,5 @@
|
||||
### Instruction:
|
||||
{{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
|
||||
4
server/templates/mpt.prompt
Normal file
4
server/templates/mpt.prompt
Normal file
@@ -0,0 +1,4 @@
|
||||
Below is an instruction that describes a task. Write a response that appropriately completes the request. Be concise. Once the request is completed, include no other text.
|
||||
### Instruction:
|
||||
{{ .Prompt }}
|
||||
### Response:
|
||||
1
server/templates/oasst.prompt
Normal file
1
server/templates/oasst.prompt
Normal file
@@ -0,0 +1 @@
|
||||
{{ .Prompt }}
|
||||
7
server/templates/orca.prompt
Normal file
7
server/templates/orca.prompt
Normal file
@@ -0,0 +1,7 @@
|
||||
### System:
|
||||
You are an AI assistant that follows instruction extremely well. Help as much as you can.
|
||||
|
||||
### User:
|
||||
{{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
2
server/templates/qlora.prompt
Normal file
2
server/templates/qlora.prompt
Normal file
@@ -0,0 +1,2 @@
|
||||
### Human: {{ .Prompt }}
|
||||
### Assistant:
|
||||
4
server/templates/tulu.prompt
Normal file
4
server/templates/tulu.prompt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
{{ .Prompt }}
|
||||
|
||||
|
||||
2
server/templates/ultralm.prompt
Normal file
2
server/templates/ultralm.prompt
Normal file
@@ -0,0 +1,2 @@
|
||||
USER: {{ .Prompt }}
|
||||
ASSISTANT:
|
||||
4
server/templates/vicuna.prompt
Normal file
4
server/templates/vicuna.prompt
Normal file
@@ -0,0 +1,4 @@
|
||||
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
|
||||
|
||||
USER: {{ .Prompt }}
|
||||
ASSISTANT:
|
||||
5
server/templates/wizardcoder.prompt
Normal file
5
server/templates/wizardcoder.prompt
Normal file
@@ -0,0 +1,5 @@
|
||||
Below is an instruction that describes a task. Write a response that appropriately completes the request
|
||||
|
||||
### Instruction: {{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
2
server/templates/wizardlm.prompt
Normal file
2
server/templates/wizardlm.prompt
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ .Prompt }}
|
||||
### Response:
|
||||
Reference in New Issue
Block a user