fix llamaboard abort

Former-commit-id: 9ef609a2c0185040e531dea3829a6f481539cdea
This commit is contained in:
hiyouga
2024-06-19 23:22:28 +08:00
parent 5f5d4c1923
commit b2f5c0e0db
2 changed files with 7 additions and 7 deletions

View File

@@ -33,16 +33,16 @@ if is_gradio_available():
import gradio as gr
def abort_leaf_process(pid: int) -> None:
def abort_process(pid: int) -> None:
r"""
Aborts the leaf processes.
Aborts the processes recursively in a bottom-up way.
"""
children = psutil.Process(pid).children()
if children:
for child in children:
abort_leaf_process(child.pid)
else:
os.kill(pid, signal.SIGABRT)
abort_process(child.pid)
os.kill(pid, signal.SIGABRT)
def can_quantize(finetuning_type: str) -> "gr.Dropdown":