Skip to content

Commit 6e147d6

Browse files
authored
fix: missing init quants in api. (#168)
1 parent 689e6df commit 6e147d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dllama-api.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ class ApiServer {
354354
int nPromptTokens;
355355
std::unique_ptr<int[]> promptTokensPtr(new int[inputPrompt.length + 2]);
356356
int *promptTokens = promptTokensPtr.get();
357-
tokenizer->encode((char*)inputPrompt.content, promptTokens, &nPromptTokens, true, true);
357+
bool addBos = startPos == 0;
358+
tokenizer->encode((char*)inputPrompt.content, promptTokens, &nPromptTokens, addBos, true);
358359

359360
pos_t promptEndPos = startPos + nPromptTokens - 1;
360361
if (promptEndPos > header->seqLen)
@@ -564,6 +565,7 @@ void usage() {
564565
}
565566

566567
int main(int argc, char *argv[]) {
568+
initQuants();
567569
initSockets();
568570

569571
int returnCode = EXIT_SUCCESS;

0 commit comments

Comments
 (0)