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

feat(option): to use different samplers #20

Closed
grencez opened this issue Apr 30, 2023 · 2 comments
Closed

feat(option): to use different samplers #20

grencez opened this issue Apr 30, 2023 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@grencez
Copy link
Contributor

grencez commented Apr 30, 2023

ggml-org/llama.cpp#1126 introduced some new ones. Right now, we use repetition penalty. It does a decent job of avoiding repeated content for a while, but it's certainly not perfect. For example, a large window penalizes a lot of punctuation and causes run-on sentences. We can already change this by excluding tokens from the penalized list, but it's a balancing act that I'm not very good at.

First order of business is to get repeat_penalty working with the new API.

@grencez grencez added the feature New feature or request label Apr 30, 2023
@grencez grencez self-assigned this Apr 30, 2023
grencez added a commit that referenced this issue Apr 30, 2023
@grencez
Copy link
Contributor Author

grencez commented Apr 30, 2023

Seems to be working as before.

New sampling parameter defaults in llama.cpp are:

tfs_z = 1.0f;
typical_p = 1.0f;
frequency_penalty = 0.0f;
presence_penalty = 0.0f;

mirostat = 0;  // 0 disabled, 1 for v1, 2 for v2.
mirostat_tau = 5.0f;
mirostat_eta = 0.1f;

Might as well add those in and try.

grencez added a commit that referenced this issue May 1, 2023
These new ones are disabled by default.

Issue #20
@grencez
Copy link
Contributor Author

grencez commented May 1, 2023

Hrm... for mirostat, it looks like we need to remember a mu value across subsequent calls. That's going to be a little tricky to maintain with undoing. Probably should make a structure that wraps & maintains the current context tokens alongside a new array of mu values that were computed for each token (or carried over from previous tokens in the case of user input).

grencez added a commit that referenced this issue May 4, 2023
This will make it easier to maintain other state variables.
Issue #20
@grencez grencez closed this as completed in 4339ba9 May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant