neura-decoder 0.7.0

Assembling the decoder only models a gguf weighs onto the graph
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use neura_graph::{Graph, Value};

pub fn partial(graph: &Graph, value: Value, position: Value, base: Value, width: u32) -> Value {
    let written = graph.shape(value).dims()[3];
    let front = graph.slice(value, 3, 0, width);
    let turned = graph.rope(front, Some(position), Some(base));
    if written == width {
        return turned;
    }
    let rest = graph.slice(value, 3, width, written - width);
    graph.concat(&[turned, rest], 3)
}