@@ -1060,7 +1060,7 @@ struct llm_tokenizer_ugm_session {
10601060 }
10611061
10621062 // initialize score_sum to -FLT_MAX so it will be always lower than sums of token scores
1063- std::vector<struct best_tokenization > tokenization_results (input_len + 1 , {vocab.token_unk (), 0 , -FLT_MAX });
1063+ std::vector<struct best_tokenization > tokenization_results (input_len + 1 , {vocab.token_unk (), 0 , -DBL_MAX });
10641064 // at the beginning tokenization score is zero
10651065 tokenization_results[0 ] = { vocab.token_unk (), 0 , 0 };
10661066
@@ -1092,7 +1092,7 @@ struct llm_tokenizer_ugm_session {
10921092 const double challenger_score = current_best.score_sum + token_score;
10931093 struct best_tokenization & current_champ = tokenization_results[prefix_offset];
10941094 if (challenger_score > current_champ.score_sum ) {
1095- struct best_tokenization challenger = { token_id, input_offset, ( float ) challenger_score };
1095+ struct best_tokenization challenger = { token_id, input_offset, challenger_score };
10961096 current_champ = challenger;
10971097 }
10981098 }
@@ -1106,7 +1106,7 @@ struct llm_tokenizer_ugm_session {
11061106 prefix_offset = input_offset + n_utf8_code_units;
11071107 struct best_tokenization & current_champ = tokenization_results[prefix_offset];
11081108 if (challenger_score > current_champ.score_sum ) {
1109- struct best_tokenization challenger = { vocab.token_unk (), input_offset, ( float ) challenger_score };
1109+ struct best_tokenization challenger = { vocab.token_unk (), input_offset, challenger_score };
11101110 current_champ = challenger;
11111111 }
11121112 }
@@ -1232,7 +1232,7 @@ struct llm_tokenizer_ugm_session {
12321232 struct best_tokenization {
12331233 llama_token token_id;
12341234 size_t input_offset;
1235- float score_sum;
1235+ double score_sum;
12361236 };
12371237
12381238 struct normalization_result normalize_prefix (const std::string & input, size_t input_offset) {
0 commit comments