Files
NexQuant/rdagent/scenarios/shared/get_runtime_info.py
T
Linlang 99a3cad9c9 chore: implement runtime_env func (#1104)
* implement runtime_env func for quant

* add runtime_info code

* add runtime env information to the prompt

* format with black

* optimize get_runtime_env code

* delete unnecessary files

* some refinement

* fix fin_quant bugs

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-07-28 14:19:41 +08:00

13 lines
437 B
Python

from pathlib import Path
from rdagent.core.experiment import FBWorkspace
from rdagent.utils.env import Env
def get_runtime_environment_by_env(env: Env) -> str:
implementation = FBWorkspace()
fname = "runtime_info.py"
implementation.inject_files(**{fname: (Path(__file__).absolute().resolve().parent / "runtime_info.py").read_text()})
stdout = implementation.execute(env=env, entry=f"python {fname}")
return stdout