Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tools/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,10 @@ int main(int argc, char ** argv) {
// LOG_DBG("last: %s\n", string_from(ctx, smpl->prev.to_vector()).c_str());

embd.push_back(id);

if (params.conversation_mode && !waiting_for_first_input && !llama_vocab_is_eog(vocab, id)) {
assistant_ss << common_token_to_piece(ctx, id, false);
}

// echo this to console
input_echo = true;
Expand Down Expand Up @@ -826,9 +830,6 @@ int main(int argc, char ** argv) {

// if current token is not EOG, we add it to current assistant message
if (params.conversation_mode && !waiting_for_first_input) {
const auto id = common_sampler_last(smpl);
assistant_ss << common_token_to_piece(ctx, id, false);

if (!prompt.empty()) {
prompt.clear();
is_interacting = false;
Expand Down
Loading