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

added breakdown bar for context #76

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

neCo2
Copy link
Contributor

@neCo2 neCo2 commented Jun 4, 2024

Added bars that show the composition of your current context in the sidebar and in the context modal. Per default, it isn't visible in the sidebar and has to be turned on in the editor settings modal.

firefox_2024-06-04_21-16-24
firefox_2024-06-04_21-16-38

We should probably talk about the colors, because it's pretty ugly right now.

@lmg-anon
Copy link
Owner

lmg-anon commented Jun 12, 2024

I think this is an interesting feature, especially if we could show how much of the context is left. But as it stands, this does look ugly and out of place. Honestly, I'm not very good with colors (or any kind of design), so I'm not sure about what to suggest in this case. Maybe for the color it would be necessary to add a palette to all themes, instead of just one color?

@neCo2
Copy link
Contributor Author

neCo2 commented Jun 13, 2024

Added a "Free Context" part to the bar. I can't test it as I don't have llamacpp set up right now, but it should work. I'll try to get it up and running again soonish and check.

As for the different colours for different themes, I frankly cannot be arsed to come up with even more colours, but I have added classes to all the bars the component generates, so it is now possible to do that.

@lmg-anon
Copy link
Owner

As for the different colours for different themes, I frankly cannot be arsed to come up with even more colours, but I have added classes to all the bars the component generates, so it is now possible to do that.

Yeah, the easiest way would be to use some algorithm to derive the colors from --color-base, but I don't know if this is even possible in a satisfactory way or if it would be possible to make it look good.
But anyway, I think it doesn't look as bad if the height is reduced (0.5em):
image

Also, strangely enough, the bar disappears when the sidebar scrollbar appears:
image
image

@neCo2
Copy link
Contributor Author

neCo2 commented Jun 17, 2024

Keep in mind that the free context part is not accurate since we just guesstimate prompt size, so it's not all that useful.

I don't know if this is even possible in a satisfactory way

Maybe I'll wrestle with that sometime when I have absolutely nothing else going on.

Also, strangely enough, the bar disappears when the sidebar scrollbar appears

Oh that's weird, never noticed that.

@lmg-anon
Copy link
Owner

Keep in mind that the free context part is not accurate since we just guesstimate prompt size, so it's not all that useful.

Hm, that's true, and this "guesstimation" must be quite off for models like LLaMA 3, which tokenize much more effectively than other models. But I guess that's not the breakdown bar's fault at least.

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.

2 participants