embed templates

This commit is contained in:
Michael Yang
2023-07-06 11:33:29 -07:00
committed by Jeffrey Morgan
parent 39f4d8edaa
commit 9b8a456c7d
14 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -0,0 +1,8 @@
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{{ .Prompt }}
### Response:

View File

@@ -0,0 +1,3 @@
A helpful assistant who helps the user with any questions asked.
User: {{ .Prompt }}
Assistant:

View File

@@ -0,0 +1,5 @@
### Instruction:
{{ .Prompt }}
### Response:

View File

@@ -0,0 +1,5 @@
### Instruction:
{{ .Prompt }}
### Response:

View 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:

View File

@@ -0,0 +1 @@
{{ .Prompt }}

View 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:

View File

@@ -0,0 +1,2 @@
### Human: {{ .Prompt }}
### Assistant:

View File

@@ -0,0 +1,4 @@
{{ .Prompt }}

View File

@@ -0,0 +1,2 @@
USER: {{ .Prompt }}
ASSISTANT:

View 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:

View File

@@ -0,0 +1,5 @@
Below is an instruction that describes a task. Write a response that appropriately completes the request
### Instruction: {{ .Prompt }}
### Response:

View File

@@ -0,0 +1,2 @@
{{ .Prompt }}
### Response: