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
ca210ba4
Commit
ca210ba4
authored
Jul 19, 2023
by
Michael Yang
Browse files
handle vnd.ollama.image.prompt for compat
parent
df146c41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
server/images.go
server/images.go
+11
-0
No files found.
server/images.go
View file @
ca210ba4
...
@@ -39,6 +39,9 @@ func (m *Model) Prompt(request api.GenerateRequest) (string, error) {
...
@@ -39,6 +39,9 @@ func (m *Model) Prompt(request api.GenerateRequest) (string, error) {
var
vars
struct
{
var
vars
struct
{
System
string
System
string
Prompt
string
Prompt
string
// deprecated: versions <= 0.0.7 used this to omit the system prompt
Context
[]
int
}
}
vars
.
System
=
m
.
System
vars
.
System
=
m
.
System
...
@@ -149,6 +152,14 @@ func GetModel(name string) (*Model, error) {
...
@@ -149,6 +152,14 @@ func GetModel(name string) (*Model, error) {
}
}
model
.
System
=
string
(
bts
)
model
.
System
=
string
(
bts
)
case
"application/vnd.ollama.image.prompt"
:
log
.
Printf
(
"PROMPT is deprecated. Please use TEMPLATE and SYSTEM instead."
)
bts
,
err
:=
os
.
ReadFile
(
filename
)
if
err
!=
nil
{
return
nil
,
err
}
model
.
Template
=
string
(
bts
)
case
"application/vnd.ollama.image.params"
:
case
"application/vnd.ollama.image.params"
:
params
,
err
:=
os
.
Open
(
filename
)
params
,
err
:=
os
.
Open
(
filename
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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