Skip to content

Add support for stopping words [Automation] #726

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

Closed
appvoid opened this issue Apr 2, 2023 · 3 comments
Closed

Add support for stopping words [Automation] #726

appvoid opened this issue Apr 2, 2023 · 3 comments

Comments

@appvoid
Copy link

appvoid commented Apr 2, 2023

A stopping criteria or "stop sequence" would be highly appreciated here. These models are already pretty for information retrieval but for automating stuff be it maybe some hacky way to execute code or simply automate textual tasks is impossible. You can just use the model and expect it to work everytime with every input. And even if is the case, your won't last long before your prompt needs a modification.

Will you at least include that feature some day? I'm mot a cpp expert so I'm not sure how difficult would be this to implement.

@prusnak
Copy link
Collaborator

prusnak commented Apr 3, 2023

Duplicate of #57

@prusnak prusnak marked this as a duplicate of #57 Apr 3, 2023
@prusnak prusnak closed this as completed Apr 3, 2023
@appvoid
Copy link
Author

appvoid commented Apr 10, 2023

You didn't get me. I'm looking for a way to automate stuff which I can't just do with that feature. For example, let's say you use a prompt to automate replies for emails.

prompt:
The following message is responded in a formal way. message: ******* output: <something similar to my expected response>

Finally, when it generates the answer, I'm not able to stop the process, feed a different prompt instead of using the original or anything to properly automate that task which pretty much renders it useless unless you use llama models as sometimes factual chatbots.

@appvoid appvoid changed the title Add support for stopping words Add support for stopping words [Automation] Apr 10, 2023
@prusnak prusnak reopened this Apr 10, 2023
@sergedc
Copy link

sergedc commented Apr 18, 2023

if (!input_noecho) {
            for (auto id : embd) {
                printf("%s", llama_token_to_str(ctx, id));
                csvoutputline += llama_token_to_str(ctx, id);
                if((int) embd.size() == 1 && (strcmp(llama_token_to_str(ctx, id), "#") == 0 || strcmp(llama_token_to_str(ctx, id), "##") == 0 || strcmp(llama_token_to_str(ctx, id), "###") == 0)) {
                    exit(0);
                }

            }

in main.cpp: look for if (!input_noecho)
My code would force exit if the AI generates # or ## or ###

Really you just need to add the if statement and get your condition right.

You cannot code c++? No worries, in 2023, only geniuses like @ggerganov need to know how to code. For everyone else, use ChatGPT, give him the code, tell him what you want and copy / paste.
Ho no, this makes me think of the movie Idiocracy. More relevant than ever.

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

4 participants