File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ int main(int argc, char ** argv) {
166
166
// tokenize the prompt
167
167
std::vector<llama_token> embd_inp;
168
168
169
- if (!params.prompt .empty () || session_tokens.empty ()) {
169
+ if (params. interactive_first || params. instruct || !params.prompt .empty () || session_tokens.empty ()) {
170
170
// Add a space in front of the first character to match OG llama tokenizer behavior
171
171
params.prompt .insert (0 , 1 , ' ' );
172
172
@@ -191,7 +191,9 @@ int main(int argc, char ** argv) {
191
191
}
192
192
n_matching_session_tokens++;
193
193
}
194
- if (n_matching_session_tokens >= embd_inp.size ()) {
194
+ if (params.prompt .empty () && n_matching_session_tokens == embd_inp.size ()) {
195
+ fprintf (stderr, " %s: using full prompt from session file\n " , __func__);
196
+ } else if (n_matching_session_tokens >= embd_inp.size ()) {
195
197
fprintf (stderr, " %s: session file has exact match for prompt!\n " , __func__);
196
198
} else if (n_matching_session_tokens < (embd_inp.size () / 2 )) {
197
199
fprintf (stderr, " %s: warning: session file has low similarity to prompt (%zu / %zu tokens); will mostly be reevaluated\n " ,
You can’t perform that action at this time.
0 commit comments