mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
6b626eb56d
* Commit init framework * Co-authored-by: Yuante Li (FESCO Adecco Human Resources) <v-yuanteli@microsoft.com> Co-authored-by: XianBW <XianBW@users.noreply.github.com> * add an import * refine the whole framework * benchmark related framework * fix black and isort errors * move requirements to folder * fix black again --------- Co-authored-by: Young <afe.young@gmail.com> Co-authored-by: xuyang1 <xuyang1@microsoft.com>
30 lines
844 B
Python
30 lines
844 B
Python
from pathlib import Path
|
|
|
|
DIRNAME = Path(__file__).absolute().resolve().parent
|
|
|
|
from rdagent.model_implementation.benchmark.eval import ModelImpValEval
|
|
from rdagent.model_implementation.one_shot import ModelTaskGen
|
|
from rdagent.model_implementation.task import ModelImpLoader, ModelTaskLoderJson
|
|
|
|
mtl = ModelTaskLoderJson("TODO: A Path to json")
|
|
|
|
task_l = mtl.load()
|
|
|
|
mtg = ModelTaskGen()
|
|
|
|
impl_l = mtg.generate(task_l)
|
|
|
|
# TODO: Align it with the benchmark framework after @wenjun's refine the evaluation part.
|
|
# Currently, we just handcraft a workflow for fast evaluation.
|
|
|
|
mil = ModelImpLoader(DIRNAME.parent.parent / "model_implementation" / "benchmark" / "gt_code")
|
|
|
|
mie = ModelImpValEval()
|
|
# Evaluation:
|
|
eval_l = []
|
|
for impl in impl_l:
|
|
gt_impl = mil.load(impl.target_task)
|
|
eval_l.append(mie.evaluate(gt_impl, impl))
|
|
|
|
print(eval_l)
|