Unverified Commit 5f7b4a5e authored by Vimal Kumar's avatar Vimal Kumar Committed by GitHub
Browse files

fix(cmd): show info may have nil ModelInfo (#6579)

parent 1aad8387
...@@ -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{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment