Enha: moke (loaded) indicator prefix instead of a suffix
This commit is contained in:
4
bot.go
4
bot.go
@@ -413,7 +413,7 @@ func fetchLCPModelsWithLoadStatus() ([]string, error) {
|
||||
for _, m := range models.Data {
|
||||
modelName := m.ID
|
||||
if m.Status.Value == "loaded" {
|
||||
modelName = modelName + " (loaded)"
|
||||
modelName = "(loaded) " + modelName
|
||||
}
|
||||
result = append(result, modelName)
|
||||
}
|
||||
@@ -1369,7 +1369,7 @@ func init() {
|
||||
var err error
|
||||
cfg, err = config.LoadConfig("config.toml")
|
||||
if err != nil {
|
||||
fmt.Println("failed to load config.toml")
|
||||
fmt.Println("failed to load config.toml", err)
|
||||
cancel()
|
||||
os.Exit(1)
|
||||
return
|
||||
|
||||
@@ -62,7 +62,7 @@ func showModelSelectionPopup() {
|
||||
}
|
||||
modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
|
||||
// Strip "(loaded)" suffix if present for local llama.cpp models
|
||||
modelName := strings.TrimSuffix(mainText, " (loaded)")
|
||||
modelName := strings.TrimPrefix(mainText, "(loaded) ")
|
||||
// Update the model in both chatBody and config
|
||||
chatBody.Model = modelName
|
||||
cfg.CurrentModel = chatBody.Model
|
||||
|
||||
Reference in New Issue
Block a user