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
f3761405
Commit
f3761405
authored
Feb 01, 2024
by
Michael Yang
Browse files
use image id
parent
e49dc9f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
server/images.go
server/images.go
+3
-2
No files found.
server/images.go
View file @
f3761405
...
@@ -182,9 +182,10 @@ func (m *Model) ChatPrompts(msgs []api.Message) (*ChatHistory, error) {
...
@@ -182,9 +182,10 @@ func (m *Model) ChatPrompts(msgs []api.Message) (*ChatHistory, error) {
currentVars
.
Prompt
=
msg
.
Content
currentVars
.
Prompt
=
msg
.
Content
for
i
:=
range
msg
.
Images
{
for
i
:=
range
msg
.
Images
{
currentVars
.
Prompt
+=
fmt
.
Sprintf
(
" [img-%d]"
,
len
(
images
)
+
i
)
id
:=
len
(
images
)
+
i
currentVars
.
Prompt
+=
fmt
.
Sprintf
(
" [img-%d]"
,
id
)
currentVars
.
Images
=
append
(
currentVars
.
Images
,
llm
.
ImageData
{
currentVars
.
Images
=
append
(
currentVars
.
Images
,
llm
.
ImageData
{
ID
:
len
(
images
)
+
i
,
ID
:
i
d
,
Data
:
msg
.
Images
[
i
],
Data
:
msg
.
Images
[
i
],
})
})
}
}
...
...
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