refactor pissa, improve llamaboard

Former-commit-id: 8baf3b22b0
This commit is contained in:
hiyouga
2024-06-28 01:04:24 +08:00
parent 1dad756cff
commit 835f0578c2
16 changed files with 219 additions and 216 deletions

View File

@@ -310,6 +310,7 @@ class Runner:
env = deepcopy(os.environ)
env["LLAMABOARD_ENABLED"] = "1"
env["LLAMABOARD_WORKDIR"] = args["output_dir"]
if args.get("deepspeed", None) is not None:
env["FORCE_TORCHRUN"] = "1"

View File

@@ -38,12 +38,15 @@ def abort_process(pid: int) -> None:
r"""
Aborts the processes recursively in a bottom-up way.
"""
children = psutil.Process(pid).children()
if children:
for child in children:
abort_process(child.pid)
try:
children = psutil.Process(pid).children()
if children:
for child in children:
abort_process(child.pid)
os.kill(pid, signal.SIGABRT)
os.kill(pid, signal.SIGABRT)
except Exception:
pass
def can_quantize(finetuning_type: str) -> "gr.Dropdown":