fix(cmd): show info may have nil ModelInfo (#6579)
This commit is contained in:
parent
1aad838707
commit
5f7b4a5e30
1 changed files with 8 additions and 5 deletions
13
cmd/cmd.go
13
cmd/cmd.go
|
@ -726,14 +726,17 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
func showInfo(resp *api.ShowResponse) {
|
||||
arch := resp.ModelInfo["general.architecture"].(string)
|
||||
|
||||
modelData := [][]string{
|
||||
{"arch", arch},
|
||||
{"parameters", resp.Details.ParameterSize},
|
||||
{"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{
|
||||
|
|
Loading…
Reference in a new issue