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

Function open_tensor_source

src/framework/assets/tensor_source.cpp:702–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700 const std::filesystem::path & index_path) {
701 const auto root = engine::io::json::parse_file(index_path);
702 const auto & object = root.require("weight_map").as_object();
703 std::unordered_map<std::string, std::string> weight_map;
704 weight_map.reserve(object.size());
705 for (const auto & [name, value] : object) {
706 weight_map.emplace(name, value.as_string());
707 }
708 if (weight_map.empty()) {
709 throw std::runtime_error("indexed tensor source has an empty weight_map: " + index_path.string());
710 }

Callers 15

load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_typed_weightsFunction · 0.85
open_tensor_sourceMethod · 0.85
load_from_directoryMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_directoryMethod · 0.85
load_from_directoryMethod · 0.85
load_ace_step_assetsFunction · 0.85

Calls

no outgoing calls

Tested by 4

run_caseFunction · 0.68
run_waveform_caseFunction · 0.68
run_caseFunction · 0.68
run_caseFunction · 0.68