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

Add reverse prompting example #17

Open
davidrpugh opened this issue Oct 16, 2024 · 0 comments
Open

Add reverse prompting example #17

davidrpugh opened this issue Oct 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@davidrpugh
Copy link
Member

llama-cli supports reverse prompting. Reverse prompts are a powerful way to create a chat-like experience with your model by pausing the text generation when specific text strings are encountered using the --reverse-prompt option.

  • -r PROMPT, --reverse-prompt PROMPT: Specify one or multiple reverse prompts to pause text generation and switch to interactive mode. For example, -r "User:" can be used to jump back into the conversation whenever it's the user's turn to speak. This helps create a more interactive and conversational experience.

The --in-prefix flag is used to add a prefix to your input, primarily, this is used to insert a space after the reverse prompt. Here's an example of how to use the --in-prefix flag in conjunction with the --reverse-prompt flag:

llama-cli -r "User:" --in-prefix " "

The --in-suffix flag is used to add a suffix after your input. This is useful for adding an "Assistant:" prompt after the user's input. It's added after the new-line character (\n) that's automatically added to the end of the user's input. Here's an example of how to use the --in-suffix flag in conjunction with the --reverse-prompt flag:

./llama-cli -r "User:" --in-prefix " " --in-suffix "Assistant:"

When --in-prefix or --in-suffix options are enabled the chat template ( --chat-template ) is disabled.

Need a good example use case for this functionality.

@davidrpugh davidrpugh added the enhancement New feature or request label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant