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
e4b9b72f
Unverified
Commit
e4b9b72f
authored
Jan 28, 2024
by
Jeffrey Morgan
Committed by
GitHub
Jan 28, 2024
Browse files
Do not repeat system prompt for chat templating (#2241)
parent
311f8e0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
server/images.go
server/images.go
+0
-4
server/routes.go
server/routes.go
+5
-0
No files found.
server/images.go
View file @
e4b9b72f
...
@@ -119,10 +119,6 @@ func Prompt(promptTemplate string, p PromptVars) (string, error) {
...
@@ -119,10 +119,6 @@ func Prompt(promptTemplate string, p PromptVars) (string, error) {
// PreResponsePrompt returns the prompt before the response tag
// PreResponsePrompt returns the prompt before the response tag
func
(
m
*
Model
)
PreResponsePrompt
(
p
PromptVars
)
(
string
,
error
)
{
func
(
m
*
Model
)
PreResponsePrompt
(
p
PromptVars
)
(
string
,
error
)
{
if
p
.
System
==
""
{
// use the default system prompt for this model if one is not specified
p
.
System
=
m
.
System
}
pre
,
_
,
err
:=
extractParts
(
m
.
Template
)
pre
,
_
,
err
:=
extractParts
(
m
.
Template
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
server/routes.go
View file @
e4b9b72f
...
@@ -239,6 +239,11 @@ func GenerateHandler(c *gin.Context) {
...
@@ -239,6 +239,11 @@ func GenerateHandler(c *gin.Context) {
Prompt
:
req
.
Prompt
,
Prompt
:
req
.
Prompt
,
First
:
len
(
req
.
Context
)
==
0
,
First
:
len
(
req
.
Context
)
==
0
,
}
}
if
promptVars
.
System
==
""
{
promptVars
.
System
=
model
.
System
}
p
,
err
:=
model
.
PreResponsePrompt
(
promptVars
)
p
,
err
:=
model
.
PreResponsePrompt
(
promptVars
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
...
...
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