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
3bac5cba
Unverified
Commit
3bac5cba
authored
Jul 22, 2025
by
Patrick Devine
Committed by
GitHub
Jul 22, 2025
Browse files
Fix GetModelInfo (#11496)
--------- Co-authored-by:
Richard Lyons
<
frob@cloudstaff.com
>
parent
4151ef8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
cmd/interactive.go
cmd/interactive.go
+12
-9
server/routes.go
server/routes.go
+5
-2
No files found.
cmd/interactive.go
View file @
3bac5cba
...
@@ -385,19 +385,22 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
...
@@ -385,19 +385,22 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
case
"modelfile"
:
case
"modelfile"
:
fmt
.
Println
(
resp
.
Modelfile
)
fmt
.
Println
(
resp
.
Modelfile
)
case
"parameters"
:
case
"parameters"
:
fmt
.
Println
(
"Model defined parameters:"
)
if
resp
.
Parameters
==
""
{
if
resp
.
Parameters
==
""
{
fmt
.
Println
(
"
No
parameters were specified for this model."
)
fmt
.
Println
(
"
No additional
parameters were specified for this model."
)
}
else
{
}
else
{
for
_
,
l
:=
range
strings
.
Split
(
resp
.
Parameters
,
"
\n
"
)
{
fmt
.
Printf
(
" %s
\n
"
,
l
)
}
}
fmt
.
Println
()
if
len
(
opts
.
Options
)
>
0
{
if
len
(
opts
.
Options
)
>
0
{
fmt
.
Println
(
"User defined parameters:"
)
fmt
.
Println
(
"User defined parameters:"
)
for
k
,
v
:=
range
opts
.
Options
{
for
k
,
v
:=
range
opts
.
Options
{
fmt
.
Printf
(
"%-*s %v
\n
"
,
30
,
k
,
v
)
fmt
.
Printf
(
"
%-*s %v
\n
"
,
30
,
k
,
v
)
}
}
fmt
.
Println
()
fmt
.
Println
()
}
}
fmt
.
Println
(
"Model defined parameters:"
)
fmt
.
Println
(
resp
.
Parameters
)
}
case
"system"
:
case
"system"
:
switch
{
switch
{
case
opts
.
System
!=
""
:
case
opts
.
System
!=
""
:
...
...
server/routes.go
View file @
3bac5cba
...
@@ -842,8 +842,11 @@ func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error) {
...
@@ -842,8 +842,11 @@ func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error) {
}
}
resp
.
Parameters
=
strings
.
Join
(
params
,
"
\n
"
)
resp
.
Parameters
=
strings
.
Join
(
params
,
"
\n
"
)
if
len
(
req
.
Options
)
>
0
{
if
m
.
Options
==
nil
{
m
.
Options
=
make
(
map
[
string
]
any
)
}
for
k
,
v
:=
range
req
.
Options
{
for
k
,
v
:=
range
req
.
Options
{
if
_
,
ok
:=
req
.
Options
[
k
];
ok
{
m
.
Options
[
k
]
=
v
m
.
Options
[
k
]
=
v
}
}
}
}
...
...
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