mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix: Use fixed file name in model costeer & fixing cache (#311)
* use fixed name in model costeer to enable cache * fix ci
This commit is contained in:
@@ -115,6 +115,7 @@ PARAM_INIT_VALUE = {param_init_value}
|
||||
dump_file_names=["execution_feedback_str.pkl", "execution_model_output.pkl"],
|
||||
local_path=str(self.workspace_path),
|
||||
env={},
|
||||
code_dump_file_py_name="model_test",
|
||||
)
|
||||
if results is None:
|
||||
raise RuntimeError(f"Error in running the model code: {log}")
|
||||
|
||||
@@ -327,11 +327,12 @@ class DockerEnv(Env[DockerConf]):
|
||||
local_path: str | None = None,
|
||||
env: dict | None = None,
|
||||
running_extra_volume: dict | None = None,
|
||||
code_dump_file_py_name: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Dump the code into the local path and run the code.
|
||||
"""
|
||||
random_file_name = f"{uuid.uuid4()}.py"
|
||||
random_file_name = f"{uuid.uuid4()}.py" if code_dump_file_py_name is None else f"{code_dump_file_py_name}.py"
|
||||
with open(os.path.join(local_path, random_file_name), "w") as f:
|
||||
f.write(code)
|
||||
entry = f"python {random_file_name}"
|
||||
|
||||
Reference in New Issue
Block a user