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 {
|
for _, m := range models.Data {
|
||||||
modelName := m.ID
|
modelName := m.ID
|
||||||
if m.Status.Value == "loaded" {
|
if m.Status.Value == "loaded" {
|
||||||
modelName = modelName + " (loaded)"
|
modelName = "(loaded) " + modelName
|
||||||
}
|
}
|
||||||
result = append(result, modelName)
|
result = append(result, modelName)
|
||||||
}
|
}
|
||||||
@@ -1369,7 +1369,7 @@ func init() {
|
|||||||
var err error
|
var err error
|
||||||
cfg, err = config.LoadConfig("config.toml")
|
cfg, err = config.LoadConfig("config.toml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("failed to load config.toml")
|
fmt.Println("failed to load config.toml", err)
|
||||||
cancel()
|
cancel()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func showModelSelectionPopup() {
|
|||||||
}
|
}
|
||||||
modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
|
modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
|
||||||
// Strip "(loaded)" suffix if present for local llama.cpp models
|
// 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
|
// Update the model in both chatBody and config
|
||||||
chatBody.Model = modelName
|
chatBody.Model = modelName
|
||||||
cfg.CurrentModel = chatBody.Model
|
cfg.CurrentModel = chatBody.Model
|
||||||
|
|||||||
Reference in New Issue
Block a user