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

[main] fix infinite generation (-n == -1) #523

Merged
merged 1 commit into from
Mar 26, 2023
Merged

Conversation

anzz1
Copy link
Contributor

@anzz1 anzz1 commented Mar 26, 2023

Fixes the command line option -n / --n_predict value -1 (generate indefinitely) in interactive mode.

@Green-Sky
Copy link
Collaborator

Green-Sky commented Mar 26, 2023

just wanted to test it and just throw a large file at it:
main: error: prompt is too long (335687 tokens, max 2044)

... i suppose thats ok, gotta pipe it to stdin then

edit: nvm, i did not think, i can just let it dream

Copy link
Collaborator

@Green-Sky Green-Sky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let it dream, but it ended itself after 516 tokens. I think it works.

@anzz1 anzz1 merged commit 7a87d31 into master Mar 26, 2023
@anzz1
Copy link
Contributor Author

anzz1 commented Mar 26, 2023

I let it dream, but it ended itself after 516 tokens. I think it works.

if you want to continue even when it think it should stop, u also need the '--ignore-eos' option to force it continue indefinitely. this is just a fix for 79b2b26 and n==-1 makes it not stop when running out of tokens. end of stream is different thing. with -n -1 --ignore-eos it should continue forever unless something goes wrong.

@rabidcopy
Copy link
Contributor

I let it dream, but it ended itself after 516 tokens. I think it works.

Did you do this with interactive or a reverse prompt? Currently EOS is only ignored with --ignore-eos or by being in interactive mode without a reverse prompt. (EOS is still technically ignored with a reverse prompt but it'll hand back the reverse prompt and give control on EOS) Otherwise just passing a prompt will still hit EOS and break.

@j-f1 j-f1 deleted the patch-fix-inf-gen branch March 26, 2023 13:31
@Green-Sky
Copy link
Collaborator

hehe, i know guys. I just forgot to enable it. 😄

Deadsg pushed a commit to Deadsg/llama.cpp that referenced this pull request Dec 19, 2023
Update tensor_split to match llama.cpp's change
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.

3 participants