Fix: avoid panic if statuslinewidget not loaded yet
This commit is contained in:
3
bot.go
3
bot.go
@@ -1400,6 +1400,9 @@ func updateModelLists() {
|
|||||||
localModelsMu.Lock()
|
localModelsMu.Lock()
|
||||||
LocalModels = ml
|
LocalModels = ml
|
||||||
localModelsMu.Unlock()
|
localModelsMu.Unlock()
|
||||||
|
for statusLineWidget == nil {
|
||||||
|
time.Sleep(time.Millisecond * 100)
|
||||||
|
}
|
||||||
// set already loaded model in llama.cpp
|
// set already loaded model in llama.cpp
|
||||||
if strings.Contains(cfg.CurrentAPI, "localhost") || strings.Contains(cfg.CurrentAPI, "127.0.0.1") {
|
if strings.Contains(cfg.CurrentAPI, "localhost") || strings.Contains(cfg.CurrentAPI, "127.0.0.1") {
|
||||||
localModelsMu.Lock()
|
localModelsMu.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user