-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathquantize.cpp
More file actions
36 lines (27 loc) · 723 Bytes
/
quantize.cpp
File metadata and controls
36 lines (27 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// add simple qunatization strategies
// adapted from : ggml/gpt-2
#include "ggml.h"
#include "ggml-alloc.h"
#include "gguf.h"
#include "dinov2.h"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <map>
#include <string>
#include <vector>
#include <regex>
#include <iostream>
#include <inttypes.h>
int main(int argc, char **argv) {
const std::string fname_inp = argv[1];
const std::string fname_out = argv[2];
const auto itype = std::atoi(argv[3]);
if (!dino_model_quantize(fname_inp, fname_out, itype)) {
fprintf(stderr, "%s: failed to quantize model from '%s'\n", __func__, fname_inp.c_str());
return 1;
}
return 0;
}