Skip to content

Commit

Permalink
fix: tokenizer error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz committed May 31, 2024
1 parent 85cfef6 commit 4e24ded
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/apps/dllama-api/dllama-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,6 @@ void handleModelsRequest(HttpRequest& request) {
}

void server(Inference* inference, SocketPool* socketPool, Tokenizer *tokenizer, Sampler *sampler, AppArgs* args, TransformerSpec* spec) {
if (tokenizer->chatEosId < 0) {
printf("⛔ 0.8.0 version introduced a new format of the tokenizer that includes chatEosId. Please update your tokenizer.\n");
exit(EXIT_FAILURE);
}

SocketServer* server = new SocketServer(args->port);

TokenizerStops stops(tokenizer);
Expand Down
6 changes: 5 additions & 1 deletion src/tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,11 @@ void Sampler::setSeed(unsigned long long seed) {
}

TokenizerStops::TokenizerStops(Tokenizer* tokenizer) {
assert(tokenizer->nChatTemplates == 6);
if (tokenizer->nChatTemplates != 6) {
printf("⛔ 0.8.0 version introduced a new format of the tokenizer that includes the chat template. Please update your tokenizer.\n");
exit(EXIT_FAILURE);
}

const bool hasExtraStop = tokenizer->chatTemplate[5][0] != '\0';
nStops = hasExtraStop ? 2 : 1;
char** s = new char*[nStops];
Expand Down

0 comments on commit 4e24ded

Please sign in to comment.