do not HTML-escape prompt

The `html/template` package automatically HTML-escapes interpolated strings in templates. This behavior is undesirable because it causes prompts like `<h1>hello` to be escaped to `&lt;h1&gt;hello` before being passed to the LLM.

The included test case passes, but before the code change, it failed:

```
--- FAIL: TestModelPrompt
    images_test.go:21: got "a&lt;h1&gt;b", want "a<h1>b"
```
This commit is contained in:
Quinn Slack
2023-09-01 17:12:20 -05:00
parent ed19d10aa5
commit 62d29b2157
2 changed files with 24 additions and 1 deletions

View File

@@ -9,7 +9,6 @@ import (
"encoding/json"
"errors"
"fmt"
"html/template"
"io"
"log"
"net/http"
@@ -21,6 +20,7 @@ import (
"runtime"
"strconv"
"strings"
"text/template"
"github.com/jmorganca/ollama/api"
"github.com/jmorganca/ollama/llm"