Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

run : fix BOS being added to each message #11302

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
wants to merge 1 commit into from
Closed

run : fix BOS being added to each message #11302

wants to merge 1 commit into from

Conversation

ericcurtin
Copy link
Collaborator

Porting the fix from simple-chat.

Porting the fix from simple-chat.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
Comment on lines +736 to +737
if (llama_tokenize(vocab, prompt.c_str(), prompt.size(), prompt_tokens.data(), prompt_tokens.size(),
llama_get_kv_cache_used_cells(llama_data.context.get()) == 0, true) < 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (llama_tokenize(vocab, prompt.c_str(), prompt.size(), prompt_tokens.data(), prompt_tokens.size(),
llama_get_kv_cache_used_cells(llama_data.context.get()) == 0, true) < 0) {
if (llama_tokenize(vocab, prompt.c_str(), prompt.size(), prompt_tokens.data(), prompt_tokens.size(),
is_first, true) < 0) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Following the simple-chat example, the first call to llama_tokenize uses this parameter:

is_first

and the second uses:

llama_get_kv_cache_used_cells(llama_data.context.get()) == 0

Copy link
Member

@ggerganov ggerganov Jan 20, 2025

Choose a reason for hiding this comment

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

Ah, I didn't even notice. Maybe this way it is better than introducing the is_first parameter.

Copy link
Collaborator Author

@ericcurtin ericcurtin Jan 20, 2025

Choose a reason for hiding this comment

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

Not pretending I know the details and just copying simple-chat :)

Copy link
Member

Choose a reason for hiding this comment

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

I pushed this variant to both simple-chat and run - seems much simpler than the is_first solution: #11311

@ericcurtin ericcurtin closed this Jan 20, 2025
@ericcurtin ericcurtin deleted the bos-run branch January 20, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.