Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/kernels/mojo_engine_v1.mojo # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / kernels / mojo_engine_v1.mojo` 26 lines ยท 827 bytes Raw Blame History 1 from std.prelude import * 2 from std.python import Python 3 from std.time import perf_counter 4 5 fn main() raises: 6 var np = Python.import_module("numpy") 7 print("NumPy version: ", np.__version__) 8 9 var sys = Python.import_module("sys") 10 sys.path.insert(0, "/onedev-workspace/work/src/mojollama/kernels") 11 12 var te = Python.import_module("turbo_engine_v7_moe") 13 print("Module loaded: ", te.__name__) 14 15 var TurboEngineV7MoE = te.TurboEngineV7MoE 16 var e = TurboEngineV7MoE("/tmp/models/gpt-oss-20b-Q4_K_M.gguf", 8) 17 18 var l0 = e.forward(0) 19 var has_nan = np.any(np.isnan(l0)) 20 print("Forward OK, NaN: ", has_nan) 21 22 var t0 = perf_counter() 23 for _ in range(10): 24 var _ = e.forward(0) 25 var t1 = perf_counter() 26 print("Throughput: ", Float64(10) / (t1 - t0), " tok/s")