Skip to content

Commit d3df98d

Browse files
committed
compress: add cmath
1 parent da444fa commit d3df98d

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

examples/compress/compress.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,13 @@
55
#include "llama.h"
66

77
#include <cstdio>
8+
#include <cmath>
89
#include <string>
910
#include <vector>
1011
#include <cassert>
1112
#include <bitset>
1213
#include <fstream>
1314

14-
int msb_log2(int x)
15-
{
16-
int ret = 0;
17-
while (x > 0)
18-
{
19-
ret++;
20-
x >>= 1;
21-
}
22-
return ret;
23-
}
24-
2515
int msB_log256(int x)
2616
{
2717
int ret = 0;
@@ -92,7 +82,6 @@ std::vector<uint8_t> encode(llama_context *ctx, std::vector<llama_token> inp, gp
9282
gpt_sampler_sample(smpl, ctx, 0, true);
9383
}
9484

95-
// bit pack sample_ids
9685
std::vector<uint8_t> sample_ids_bitpacked;
9786

9887
int bit_offset = 0;

0 commit comments

Comments
 (0)