Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete revamp of model loading to allow for more discrete control #1969

Merged
merged 7 commits into from
Feb 21, 2024

Conversation

manyoso
Copy link
Collaborator

@manyoso manyoso commented Feb 15, 2024

Large revamp of model loading.

the user of the models loading behavior.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
@cebtenzzre cebtenzzre changed the title Complete revamp of model loading to allow for more discreet control by Complete revamp of model loading to allow for more discrete control Feb 15, 2024
@@ -170,7 +222,7 @@ bool ChatLLM::loadModel(const ModelInfo &modelInfo)
#endif
delete m_llModelInfo.model;
m_llModelInfo.model = nullptr;
emit isModelLoadedChanged(false);
emit modelLoadingPercentageChanged(std::numeric_limits<float>::min());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a comment explaining the significance of negative infinity here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not negative infinite. It is the smallest possible positive floating point value closest to zero.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sometimes I forget that FLT_MIN has nothing to do with INT_MIN. I'm thinking there should be a brief comment like // small nonzero value to make it clear that it is arbitrary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments.

gpt4all-chat/main.qml Outdated Show resolved Hide resolved
gpt4all-chat/main.qml Outdated Show resolved Hide resolved
@cebtenzzre

This comment was marked as resolved.

@cebtenzzre

This comment was marked as resolved.

@cebtenzzre
Copy link
Member

Also, attempting to switch models while a model is loading is allowed - it changes the model name but not the progress value, and it ends up queueing a series of model loads. We should either abort the model load via the progress callback, or prevent the user from doing this.

@cebtenzzre
Copy link
Member

Is this dialog still necessary, when selecting a model that previously failed to load? Especially the "Model loading error..." at the top.

Screenshot 2024-02-15 at 5 03 04 PM

@cebtenzzre
Copy link
Member

cebtenzzre commented Feb 15, 2024

This combo box is too wide now that the Clone/Remove buttons are gone:

Screenshot 2024-02-15 at 5 07 44 PM

Also, half of the generation settings are off the edge of the dialog (not visible).

edit: Apparently also seen in the 2.7.0 release on Windows, see the Discord.

@cebtenzzre

This comment was marked as resolved.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
@manyoso
Copy link
Collaborator Author

manyoso commented Feb 19, 2024

All of the above should be fixed with this newest version. Thanks for the quality review.

@ThiloteE
Copy link
Collaborator

Nitpick: Models with long names bleed into symbols.
Shouldn't prevent a merge, but wanted to mention it.

image

@ThiloteE
Copy link
Collaborator

Also, having multiple conversations with different models and switching between them causes long (few seconds long) "switching context" messages.
image.
Is it because the prompt is evaluated on CPU immediatelly?

@manyoso
Copy link
Collaborator Author

manyoso commented Feb 20, 2024

Nitpick: Models with long names bleed into symbols. Shouldn't prevent a merge, but wanted to mention it.

Fixed.

@manyoso
Copy link
Collaborator Author

manyoso commented Feb 20, 2024

Also, having multiple conversations with different models and switching between them causes long (few seconds long) "switching context" messages.

This has to do with the save/restore of context that can be slow under vulkan. We're looking at ways to speed it up.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
@ThiloteE
Copy link
Collaborator

ThiloteE commented Feb 20, 2024

Thank you. Can confirm it is much better now. To be honest though, adding slightly to the width wouldn't hurt, because most models on huggingface do have long model names, especially the mergers. Also, if users have multiple model cards for them (e.g. various system prompts in different languages) then those model names might become even longer to avoid confusion.

image

@cebtenzzre
Copy link
Member

A. Things look wrong at the minimum window size - and in general, when the window width is less than 3/4 of my screen.

Screenshot 2024-02-20 at 10 40 05 AM

B. I liked the font size of the regenerate button better before:
Screenshot 2024-02-20 at 10 43 32 AM
Than it is now:
Screenshot 2024-02-20 at 10 43 46 AM

C.

This combo box is too wide now that the Clone/Remove buttons are gone:

This is still the case, the combo box goes off the edge of the dialog.

D. If you:

  1. Select a model and chat with it
  2. Unload the model
  3. Instead of clicking reload, or selecting a different model, select the same model again
  4. Your chat session has now been cleared??

E. The way we handle crashes during model loading is still broken - not only is there a dialog without OK/Cancel buttons that appears when the user explicitly tries to load the same model again, but the model switcher actually completely freezes now, and the app has to be restarted in order to continue. And you can never load that model again until you successfully load a different one.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
@manyoso
Copy link
Collaborator Author

manyoso commented Feb 20, 2024

I don't know what you mean by "This is still the case, the combo box goes off the edge of the dialog." as I don't see that.

The sizing issues with min width and so on are not germane to this PR. I'd like to address them in another PR. Moreover, they are going to go away when the new UI revamp comes so I don't want to spend much time on them.

@manyoso
Copy link
Collaborator Author

manyoso commented Feb 20, 2024

I've fixed D. I'm not sure about E and what we want to do. It should probably be addressed in a new PR.

@cebtenzzre
Copy link
Member

cebtenzzre commented Feb 20, 2024

The sizing issues with min width and so on are not germane to this PR. I'd like to address them in another PR. Moreover, they are going to go away when the new UI revamp comes so I don't want to spend much time on them.

Ok. But the clear chat button didn't overlap before because the model selection box was smaller, so this is a regression, even if you think it's not important.

I don't know what you mean by "This is still the case, the combo box goes off the edge of the dialog." as I don't see that.

On my Mac:
Screenshot 2024-02-20 at 2 53 59 PM

Notice how:

  • The "Generation Settings" header that is supposed to be centered is now shifted to the right
  • The right column of generation settings is cut off (as in, I cannot see the right half of each inputbox)
  • The expanded combobox to select a model stretches outside of the settings dialog and onto the dimmed background behind it (to the right)

@manyoso
Copy link
Collaborator Author

manyoso commented Feb 20, 2024

Ok. But the clear chat button didn't overlap before because the model selection box was smaller, so this is a regression, even if you think it's not important.

Got it, thanks.

On my Mac:

Yeah, I don't see anything like this. I'll check on my mac.

Copy link

@barnett-yuxiang barnett-yuxiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@manyoso
Copy link
Collaborator Author

manyoso commented Feb 21, 2024

I cannot reproduce what you see on the mac with the model settings. Further, this change does not seem to have any impact on the model settings or that combo box. I'm not sure why you see what you see @cebtenzzre

Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
@manyoso
Copy link
Collaborator Author

manyoso commented Feb 21, 2024

The model loading error you get when app crashes and we display on reload is now gone.

@manyoso manyoso merged commit fa0a212 into main Feb 21, 2024
6 of 17 checks passed
@ThiloteE
Copy link
Collaborator

fixed #1660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants