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

Prevent starchat from generating nonsense after ouptutting <|system|> <|end|> <|user|> #32

Open
KukumavMozolo opened this issue Aug 22, 2023 · 0 comments

Comments

@KukumavMozolo
Copy link

When using starchat the model will likely start talking bullshit (in Spanish) after printing out the sequence:

<|system|> <|end|> <|user|>

I added a rudimentary fix to stop generating new tokens in case starchat is used after outputting <|system|> <|end|> <|user|>:

        // check if model is santacoder
        if (model.hparams.n_layer <= 30 && embd.back() == 49152) {
            break;
        }
        // check if model is starcoder
        else if (embd.back() == 0) { //TODO: this is only for starcoder
            break;
        }
        // starchat since only these 3 models are supported atm
        else{
            // break to prevent starchat from talking gibberish
            if (output.find("<|system|>\n<|end|>\n<|user|>") != std::string::npos) {
                break;
            }
        }

Would that be desirable pr? And also what is the correct way to detect if the model is indeed starcoder instead of using the default?

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

No branches or pull requests

1 participant