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
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"embed"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -19,7 +20,9 @@ import (
|
|||||||
"github.com/jmorganca/ollama/llama"
|
"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) {
|
func generate(c *gin.Context) {
|
||||||
// TODO: these should be request parameters
|
// TODO: these should be request parameters
|
||||||
|
|||||||
Reference in New Issue
Block a user