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

Function lower_ascii

src/framework/assets/tensor_source.cpp:46–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// Identifies a tensor container from its leading bytes. Returns nullopt when the file is unreadable or
45// matches no known container. Torch checkpoints are not sniffed: they are ZIP or pickle streams that
46// cannot be told apart reliably from other files.
47std::optional<TensorContainer> sniff_tensor_container(const std::filesystem::path & path) {
48 std::ifstream in(path, std::ios::binary);
49 if (!in) return std::nullopt;
50 char head[9] = {};
51 in.read(head, sizeof(head));
52 const auto count = in.gcount();
53 if (count >= 4 && std::memcmp(head, "GGUF", 4) == 0) return TensorContainer::Gguf;
54 // Safetensors: little-endian u64 header size, followed by a JSON object.
55 if (count == 9 && head[8] == '{') {

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected