@@ -44,7 +44,7 @@ def _war_check_output(*args, **kwargs):
4444    return  venv .run_cmd (cmd , caller = _war_check_output , env = env , ** kwargs )
4545
4646
47- def  venv_mpi_check_call (venv , mpi_cmd , python_cmd ):
47+ def  venv_mpi_check_call (venv , mpi_cmd , python_cmd ,  ** kwargs ):
4848    """ 
4949    This function WAR check_call() to run python_cmd with mpi. 
5050    If mpi_cmd = ["mpirun", "-n", "2"] and python_cmd = ["run.py"], the command will be: 
@@ -61,10 +61,10 @@ def _war_check_call(*args, **kwargs):
6161        kwargs ["cwd" ] =  venv .get_working_directory ()
6262        return  check_call (merged_cmd , ** kwargs )
6363
64-     venv .run_cmd (python_cmd , caller = _war_check_call )
64+     venv .run_cmd (python_cmd , caller = _war_check_call ,  ** kwargs )
6565
6666
67- def  venv_mpi_check_output (venv , mpi_cmd , python_cmd , env = None ):
67+ def  venv_mpi_check_output (venv , mpi_cmd , python_cmd , env = None ,  ** kwargs ):
6868    """ 
6969    This function WAR check_output() to run python_cmd with mpi. 
7070    If mpi_cmd = ["mpirun", "-n", "2"] and python_cmd = ["run.py"], the command will be: 
@@ -81,7 +81,7 @@ def _war_check_output(*args, **kwargs):
8181        kwargs ["cwd" ] =  venv .get_working_directory ()
8282        return  check_output (merged_cmd , ** kwargs )
8383
84-     return  venv .run_cmd (python_cmd , caller = _war_check_output , env = env )
84+     return  venv .run_cmd (python_cmd , caller = _war_check_output , env = env ,  ** kwargs )
8585
8686
8787def  parse_mpi_cmd (cmd ):
@@ -506,6 +506,7 @@ def convert_weights(llm_venv,
506506        convert_cmd .append (f"--quant_ckpt_path={ quant_ckpt_path }  )
507507    if  per_group :
508508        convert_cmd .append ("--per_group" )
509+     timeout  =  kwargs .pop ('timeout' , None )
509510
510511    for  key , value  in  kwargs .items ():
511512        if  isinstance (value , bool ):
@@ -515,7 +516,7 @@ def convert_weights(llm_venv,
515516            convert_cmd .extend ([f"--{ key } { value }  ])
516517
517518    if  llm_venv :
518-         venv_check_call (llm_venv , convert_cmd )
519+         venv_check_call (llm_venv , convert_cmd ,  timeout = timeout )
519520        return  model_dir 
520521    else :
521522        return  convert_cmd , model_dir 
@@ -607,6 +608,7 @@ def quantize_data(llm_venv,
607608
608609    if  kv_cache_dtype :
609610        quantize_cmd .append (f"--kv_cache_dtype={ kv_cache_dtype }  )
611+     timeout  =  kwargs .pop ('timeout' , None )
610612
611613    for  key , value  in  kwargs .items ():
612614        if  isinstance (value , bool ):
@@ -617,7 +619,7 @@ def quantize_data(llm_venv,
617619
618620    if  llm_venv :
619621        if  not  exists (output_dir ):
620-             venv_check_call (llm_venv , quantize_cmd )
622+             venv_check_call (llm_venv , quantize_cmd ,  timeout = timeout )
621623        return  output_dir 
622624    else :
623625        return  quantize_cmd , output_dir 
0 commit comments