MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / string_to_quant

Function string_to_quant

src/codec.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24std::optional<Quant> string_to_quant(const std::string& quant_str) {
25 if (quant_str == "F32") {
26 return Quant::F32;
27 } else if (quant_str == "F16") {
28 return Quant::F16;
29 } else if (quant_str == "F8_E5M2") {
30 return Quant::F8E5M2;
31 } else if (quant_str == "Q2_K") {
32 return Quant::Q2_K;
33 } else if (quant_str == "Q3_K") {
34 return Quant::Q3_K;
35 } else {
36 return std::nullopt;
37 }
38}
39
40double bits_per_weight(Quant quant, size_t blockwise_quant_size) {
41 if (blockwise_quant_size > 0 && quant != Quant::F8E5M2) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected