mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-28 07:57:44 +00:00
8662211492
* several improvement on kaggle loop * small refinement on prompt * fix bugs * add the score of each model in every experiment * fix ci error * fix error in ventilator tpl * fix CI --------- Co-authored-by: Xu Yang <xuyang1@microsoft.com> Co-authored-by: Bowen Xian <xianbowen@outlook.com> Co-authored-by: WinstonLiye <1957922024@qq.com> Co-authored-by: TPLin22 <tplin2@163.com>
26 lines
976 B
Python
26 lines
976 B
Python
import pickle
|
|
import shutil
|
|
from pathlib import Path
|
|
from typing import Any, Tuple
|
|
|
|
from rdagent.core.developer import Developer
|
|
from rdagent.core.experiment import ASpecificExp, Experiment
|
|
from rdagent.oai.llm_utils import md5_hash
|
|
|
|
|
|
class CachedRunner(Developer[ASpecificExp]):
|
|
def get_cache_key(self, exp: Experiment) -> str:
|
|
all_tasks = []
|
|
for based_exp in exp.based_experiments:
|
|
all_tasks.extend(based_exp.sub_tasks)
|
|
all_tasks.extend(exp.sub_tasks)
|
|
task_info_list = [task.get_task_information() for task in all_tasks]
|
|
task_info_str = "\n".join(task_info_list)
|
|
return md5_hash(task_info_str)
|
|
|
|
def assign_cached_result(self, exp: Experiment, cached_res: Experiment) -> Experiment:
|
|
if exp.based_experiments and exp.based_experiments[-1].result is None:
|
|
exp.based_experiments[-1].result = cached_res.based_experiments[-1].result
|
|
exp.result = cached_res.result
|
|
return exp
|