mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-05 19:17:43 +00:00
bbcee389b4
* 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>
13 lines
437 B
Python
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
|