(model Model)
| 899 | } |
| 900 | |
| 901 | func (m *AppModel) inspectModelView(model Model) string { |
| 902 | logging.DebugLogger.Printf("Inspecting model view: %+v\n", model) // Log the model being inspected |
| 903 | |
| 904 | columns := []table.Column{ |
| 905 | {Title: "Property", Width: 25}, |
| 906 | {Title: "Value", Width: 50}, |
| 907 | } |
| 908 | |
| 909 | // Get enhanced model information using the new API |
| 910 | enhancedInfo, err := getEnhancedModelInfo(model.Name, m.client) |
| 911 | if err != nil { |
| 912 | logging.ErrorLogger.Printf("Error getting enhanced model info: %v\n", err) |
| 913 | // Fall back to basic information if enhanced info fails |
| 914 | enhancedInfo = &EnhancedModelInfo{} |
| 915 | } |
| 916 | |
| 917 | // Use getModelParams to get the model parameters for backward compatibility |
| 918 | modelParams, _, paramErr := getModelParams(model.Name, m.client) |
| 919 | if paramErr != nil { |
| 920 | logging.ErrorLogger.Printf("Error getting model parameters: %v\n", paramErr) |
| 921 | } |
| 922 | |
| 923 | // Start with basic model information |
| 924 | rows := []table.Row{ |
| 925 | {"Name", model.Name}, |
| 926 | {"ID", model.ID}, |
| 927 | {"Size (GB)", fmt.Sprintf("%.2f", model.Size)}, |
| 928 | } |
| 929 | |
| 930 | // Add enhanced information if available, only showing fields that have values |
| 931 | if enhancedInfo.ParameterSize != "" { |
| 932 | rows = append(rows, table.Row{"Parameter Size", enhancedInfo.ParameterSize}) |
| 933 | } |
| 934 | |
| 935 | if enhancedInfo.QuantizationLevel != "" { |
| 936 | rows = append(rows, table.Row{"Quantisation Level", enhancedInfo.QuantizationLevel}) |
| 937 | } else if model.QuantizationLevel != "" { |
| 938 | rows = append(rows, table.Row{"Quantisation Level", model.QuantizationLevel}) |
| 939 | } |
| 940 | |
| 941 | if enhancedInfo.Format != "" { |
| 942 | rows = append(rows, table.Row{"Format", enhancedInfo.Format}) |
| 943 | } |
| 944 | |
| 945 | if enhancedInfo.Family != "" { |
| 946 | rows = append(rows, table.Row{"Family", enhancedInfo.Family}) |
| 947 | } else if model.Family != "" { |
| 948 | rows = append(rows, table.Row{"Family", model.Family}) |
| 949 | } |
| 950 | |
| 951 | if enhancedInfo.ContextLength > 0 { |
| 952 | rows = append(rows, table.Row{"Context Length", fmt.Sprintf("%d", enhancedInfo.ContextLength)}) |
| 953 | } |
| 954 | |
| 955 | if enhancedInfo.EmbeddingLength > 0 { |
| 956 | rows = append(rows, table.Row{"Embedding Length", fmt.Sprintf("%d", enhancedInfo.EmbeddingLength)}) |
| 957 | } |
| 958 |
no test coverage detected