# shellcheck shell=dash

___x_cmd_whisper_model_export(){
    local model_name="$1"
    local tarfp="$2"
    [ -n "$model_name" ] || N=whisper M="model name is required" log:ret:64
    [ -n "$tarfp" ]      || N=whisper M="target path is required" log:ret:64

    local srcfp="$___X_CMD_ROOT_DATA/model/${model_name}.bin"
    [ -f "$srcfp" ] || N=whisper M="Model [file=$srcfp] not found" log:ret:1
    ___x_cmd mkdirp "$tarfp"

    whisper:info "export the [model=$model_name] to $tarfp"
    ___x_cmd_cmds cp "$srcfp" "$tarfp"
}
