MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / decode_f32

Function decode_f32

src/framework/assets/torch_bin.cpp:441–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439 for (auto & item : items) {
440 stack_.back().items.push_back(std::move(item));
441 }
442 }
443 std::vector<PickleValue> finish() {
444 const PickleValue result = pop();
445 if (result.kind == PickleValue::Kind::Tensor) {
446 return {str_value("tensor"), result};
447 }
448 if (result.kind != PickleValue::Kind::Dict) {
449 throw std::runtime_error("torch .bin pickle did not produce a state dict");
450 }
451 // A training checkpoint saved as {"state_dict": ..., "metadata": ...} (Semantic-DACVAE's
452 // weights.pth) keeps its weights in the inner dict; the rest is not tensor data.
453 for (size_t i = 0; i + 1 < result.items.size(); i += 2) {
454 if (result.items[i].kind == PickleValue::Kind::Str && result.items[i].text == "state_dict" &&
455 result.items[i + 1].kind == PickleValue::Kind::Dict) {
456 return result.items[i + 1].items;

Callers 1

require_f32Method · 0.85

Calls 3

ggml_fp16_to_fp32_rowFunction · 0.85
ggml_bf16_to_fp32_rowFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected