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

Make compress_pos_emb float #6276

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

hocjordan
Copy link
Contributor

@hocjordan hocjordan commented Jul 26, 2024

compress_pos_emb originally had a slider gradation of 0.01, allowing the user to set float values, but this behaviour was changed in #6233. The UI now uses gr.Number instead of gr.Slider to represent RoPE scaling values so that devs don't have to repeatedly update the max value limit and as a side effect the gradation of compress_pos_emb became integer.

I find float values useful (a value of 1.3 allows Llama 3.0 models to work nicely with a 12k context, whereas 1 is insufficient and 2 causes noticeable drop in quality). This PR therefore replicates the previous behaviour by setting the precision to 2.

I have tested the change by setting compress_pos_emb to 1.3 and confirming that the value sent to llama.cpp is correct, i.e.

llama_new_context_with_model: freq_scale = 0.769231

I don't believe that this will cause problems with the rest of the code because float values were originally permitted.

Checklist:

@hocjordan hocjordan marked this pull request as ready for review July 26, 2024 12:40
Originally, compress_pos_emb had a slider gradation of 0.01. However,
webui now uses gr.Number instead of gr.Slider to represent the value
(to avoid having to repeatedly update max value limit) and the precision
was set to 0. Setting precision to 0.01 to return to previous behaviour.
@hocjordan hocjordan force-pushed the make_compress_pos_emb_float branch from 314283f to 221ec15 Compare July 26, 2024 12:44
@oobabooga
Copy link
Owner

Thank you!

@oobabooga oobabooga merged commit 078e8c8 into oobabooga:dev Jul 28, 2024
@hocjordan hocjordan deleted the make_compress_pos_emb_float branch July 28, 2024 08:30
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