utils
staging_directory
def staging_directory(command: str, old_path: str, new_path: str) -> str
Replace directory paths in command and copy directory for distributed training.
Only rank 0 performs the copy operation.
Arguments:
command- The shell command stringold_path- Path to replacenew_path- New path to use
Returns:
Modified command string
Raises:
FileNotFoundError- If old_path doesn't existOSError- If copying fails
replace_params_to_file
def replace_params_to_file(input_filepath: str, output_filepath: str,
params: Dict[str, Any]) -> None
Replace parameters in a file with given values.
Arguments:
input_filepathstr - Path to the input file.output_filepathstr - Path to the output file.paramsDict[str, Any] - Dictionary of parameters to replace.