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
4a1abfe4
Commit
4a1abfe4
authored
Dec 13, 2023
by
Jeffrey Morgan
Browse files
fix tests
parent
bbd41494
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
cmd/cmd.go
cmd/cmd.go
+3
-2
server/images_test.go
server/images_test.go
+1
-1
No files found.
cmd/cmd.go
View file @
4a1abfe4
...
...
@@ -951,7 +951,8 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
cmd
.
SetContext
(
ctx
)
}
if
len
(
opts
.
Images
)
==
0
{
fmt
.
Println
(
"This model requires you to add a jpeg, png, or svg image.
\n
"
)
fmt
.
Println
(
"This model requires you to add a jpeg, png, or svg image."
)
fmt
.
Println
()
prompt
=
""
continue
}
...
...
@@ -1069,7 +1070,7 @@ func getImageData(filePath string) ([]byte, error) {
// Check if the file size exceeds 100MB
var
maxSize
int64
=
100
*
1024
*
1024
// 100MB in bytes
if
info
.
Size
()
>
maxSize
{
return
nil
,
fmt
.
Errorf
(
"file size exceeds maximum limit (100MB)
.
"
)
return
nil
,
fmt
.
Errorf
(
"file size exceeds maximum limit (100MB)"
)
}
buf
=
make
([]
byte
,
info
.
Size
())
...
...
server/images_test.go
View file @
4a1abfe4
...
...
@@ -81,7 +81,7 @@ func TestChat(t *testing.T) {
Template
:
tt
.
template
,
}
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
got
,
err
:=
m
.
ChatPrompt
(
tt
.
msgs
)
got
,
_
,
err
:=
m
.
ChatPrompt
(
tt
.
msgs
)
if
tt
.
wantErr
!=
""
{
if
err
==
nil
{
t
.
Errorf
(
"ChatPrompt() expected error, got 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