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
5f7b4a5e
Unverified
Commit
5f7b4a5e
authored
Sep 01, 2024
by
Vimal Kumar
Committed by
GitHub
Aug 31, 2024
Browse files
fix(cmd): show info may have nil ModelInfo (#6579)
parent
1aad8387
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
cmd/cmd.go
cmd/cmd.go
+8
-5
No files found.
cmd/cmd.go
View file @
5f7b4a5e
...
@@ -726,14 +726,17 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
...
@@ -726,14 +726,17 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
}
}
func
showInfo
(
resp
*
api
.
ShowResponse
)
{
func
showInfo
(
resp
*
api
.
ShowResponse
)
{
arch
:=
resp
.
ModelInfo
[
"general.architecture"
]
.
(
string
)
modelData
:=
[][]
string
{
modelData
:=
[][]
string
{
{
"arch"
,
arch
},
{
"parameters"
,
resp
.
Details
.
ParameterSize
},
{
"parameters"
,
resp
.
Details
.
ParameterSize
},
{
"quantization"
,
resp
.
Details
.
QuantizationLevel
},
{
"quantization"
,
resp
.
Details
.
QuantizationLevel
},
{
"context length"
,
fmt
.
Sprintf
(
"%v"
,
resp
.
ModelInfo
[
fmt
.
Sprintf
(
"%s.context_length"
,
arch
)]
.
(
float64
))},
}
{
"embedding length"
,
fmt
.
Sprintf
(
"%v"
,
resp
.
ModelInfo
[
fmt
.
Sprintf
(
"%s.embedding_length"
,
arch
)]
.
(
float64
))},
if
resp
.
ModelInfo
!=
nil
{
arch
:=
resp
.
ModelInfo
[
"general.architecture"
]
.
(
string
)
modelData
=
append
(
modelData
,
[]
string
{
"arch"
,
arch
},
[]
string
{
"context length"
,
fmt
.
Sprintf
(
"%v"
,
resp
.
ModelInfo
[
fmt
.
Sprintf
(
"%s.context_length"
,
arch
)]
.
(
float64
))},
[]
string
{
"embedding length"
,
fmt
.
Sprintf
(
"%v"
,
resp
.
ModelInfo
[
fmt
.
Sprintf
(
"%s.embedding_length"
,
arch
)]
.
(
float64
))},
)
}
}
mainTableData
:=
[][]
string
{
mainTableData
:=
[][]
string
{
...
...
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