mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-13 06:19:20 +00:00
Make the retrieval/parsing of models.json sync on startup. We were jumping to many hoops to mitigate the async behavior.
This commit is contained in:
@@ -207,28 +207,9 @@ Window {
|
||||
textRole: "name"
|
||||
property string currentModelName: ""
|
||||
function updateCurrentModelName() {
|
||||
// During application startup the model names might not be processed yet, so don't
|
||||
// set the combobox text until this is done OR the timer has timed out
|
||||
if (!ModelList.modelHasNames && startupTimer.running)
|
||||
return
|
||||
var info = ModelList.modelInfo(currentChat.modelInfo.filename);
|
||||
comboBox.currentModelName = info.name !== "" ? info.name : info.filename;
|
||||
}
|
||||
Timer {
|
||||
id: startupTimer
|
||||
interval: 3000 // 3 seconds
|
||||
running: true
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
comboBox.updateCurrentModelName();
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: ModelList
|
||||
function onModelHasNamesChanged() {
|
||||
comboBox.updateCurrentModelName();
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: currentChat
|
||||
function onModelInfoChanged() {
|
||||
|
Reference in New Issue
Block a user