mirror of
https://github.com/ollama/ollama.git
synced 2026-02-20 00:05:06 -05:00
This change adds a new MLX based runner which includes: * Method-based MLX bindings * Subprocess-based MLX runner (x/mlxrunner) * KV cache with tree management * A basic sampler The GLM4-MoE-Lite model has been ported to use the new bindings. --------- Co-authored-by: Michael Yang <git@mxy.ng>
14 lines
254 B
Go
14 lines
254 B
Go
//go:build mlx
|
|
|
|
package mlx
|
|
|
|
// #include "generated.h"
|
|
import "C"
|
|
|
|
func (t *Array) Categorical(axis int) *Array {
|
|
key := New("")
|
|
out := New("", t, key)
|
|
C.mlx_random_categorical(&out.ctx, t.ctx, C.int(axis), key.ctx, DefaultStream().ctx)
|
|
return out
|
|
}
|