Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
adaa1308
Unverified
Commit
adaa1308
authored
Sep 01, 2023
by
Michael Yang
Committed by
GitHub
Sep 01, 2023
Browse files
Merge pull request #457 from sqs/dont-html-escape-prompt
do not HTML-escape prompt
parents
ed19d10a
62d29b21
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
server/images.go
server/images.go
+1
-1
server/images_test.go
server/images_test.go
+23
-0
No files found.
server/images.go
View file @
adaa1308
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
"html/template"
"io"
"io"
"log"
"log"
"net/http"
"net/http"
...
@@ -21,6 +20,7 @@ import (
...
@@ -21,6 +20,7 @@ import (
"runtime"
"runtime"
"strconv"
"strconv"
"strings"
"strings"
"text/template"
"github.com/jmorganca/ollama/api"
"github.com/jmorganca/ollama/api"
"github.com/jmorganca/ollama/llm"
"github.com/jmorganca/ollama/llm"
...
...
server/images_test.go
0 → 100644
View file @
adaa1308
package
server
import
(
"testing"
"github.com/jmorganca/ollama/api"
)
func
TestModelPrompt
(
t
*
testing
.
T
)
{
var
m
Model
req
:=
api
.
GenerateRequest
{
Template
:
"a{{ .Prompt }}b"
,
Prompt
:
"<h1>"
,
}
s
,
err
:=
m
.
Prompt
(
req
,
""
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
want
:=
"a<h1>b"
if
s
!=
want
{
t
.
Errorf
(
"got %q, want %q"
,
s
,
want
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment