MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / load_reference

Function load_reference

kernelbench/bench_kb.py:115–131  ·  view source on GitHub ↗

Load the reference Model, get_inputs, get_init_inputs from workspace.

()

Source from the content-addressed store, hash-verified

113
114
115def load_reference():
116 """Load the reference Model, get_inputs, get_init_inputs from workspace."""
117 ref_path = KB_ACTIVE_DIR / "reference.py"
118 if not ref_path.exists():
119 print("ERROR: No active KernelBench problem.")
120 print(" Run: uv run kernelbench/bridge.py setup --level 1 --problem 1")
121 sys.exit(1)
122 mod = _load_module_from_path(ref_path, "_kb_reference")
123 Model = getattr(mod, "Model", None)
124 get_inputs = getattr(mod, "get_inputs", None)
125 get_init_inputs = getattr(mod, "get_init_inputs", None)
126 if Model is None or get_inputs is None:
127 print("ERROR: reference.py must define Model, get_inputs(), get_init_inputs().")
128 sys.exit(1)
129 if get_init_inputs is None:
130 get_init_inputs = lambda: []
131 return Model, get_inputs, get_init_inputs
132
133
134def load_kernel():

Callers 1

mainFunction · 0.85

Calls 1

_load_module_from_pathFunction · 0.85

Tested by

no test coverage detected