compress: add cmath
This commit is contained in:
parent
da444fafd7
commit
d3df98d6ea
1 changed files with 1 additions and 12 deletions
|
@ -5,23 +5,13 @@
|
||||||
#include "llama.h"
|
#include "llama.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
int msb_log2(int x)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
while (x > 0)
|
|
||||||
{
|
|
||||||
ret++;
|
|
||||||
x >>= 1;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int msB_log256(int x)
|
int msB_log256(int x)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -92,7 +82,6 @@ std::vector<uint8_t> encode(llama_context *ctx, std::vector<llama_token> inp, gp
|
||||||
gpt_sampler_sample(smpl, ctx, 0, true);
|
gpt_sampler_sample(smpl, ctx, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bit pack sample_ids
|
|
||||||
std::vector<uint8_t> sample_ids_bitpacked;
|
std::vector<uint8_t> sample_ids_bitpacked;
|
||||||
|
|
||||||
int bit_offset = 0;
|
int bit_offset = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue