<commit_before>#!/bin/bash
# 
# DESCRIPTION
# 
#       Given a sentence file and (optionally) prerecorded audio files, produce a voice model in 
#       a specified location.  Indicate whether to record (-record) or import (-import) the 
#       audio files.
# 
# USAGE
# 
#       vmc.sh model-name [ -record OR -import audio/file/directory ] sentence-file output-folder [reps]
#
# DEPENDENCIES
# 
#       CMU Sphinx, Python 3 (& 2.7), Perl, and other misc. packages.
# 
# NOTES
# 
#       The output folder is intended to be the location of the voice model, once completed.
# 
#       The [reps] variable at the end specifies how many times to request a recording of each 
#       entry in the sentence file.  It is optional, as it is placed at the end of the list of 
#       parameters and the script will not fail if it is not specified.
# 
#       Having been installed to /usr/local/bin, this command can be called from anywhere.
# 

# VARIABLES =======================================================================================

export LD_LIBRARY_PATH=/usr/local/lib
        # set path to include sphinx library location 
        # https://jrmeyer.github.io/installation/2016/01/09/Installing-CMU-Sphinx-on-Ubuntu.html

if [[ $2 = '-record' ]]; then 

    sentence_file=$3
    output_folder=$4

    if [[ -z $5 ]]; then
        iterations=$5
    else
        iterations=1
    fi

elif [[ $2 = '-import' ]]; then

    audio_file_directory=$3
    sentence_file=$4
    output_folder=$5

else

    echo "USAGE: bash vmc.sh model-name [ -record OR -import audio/file/dir ] sentence-file output-folder [reps]"
    exit 1

fi

model_name=$1

audio_folder=$output_folder/audio

tdir=/opt/vmc/tools 

fdir=/opt/vmc/functions


# COMMANDS ========================================================================================

# OBTAIN REQUISITE FILES --------------------------------------------------------------------------

# get audio files
if [ $1 = '-record' ]; then 

    mkdir -p $audio_folder

    python3 $fdir/getaudio.py $sentence_file $audio_folder $iterations $model_name

elif [ $1 = '-import' ]; then
<commit_msg>bash command not required to run<commit_after>#!/bin/bash
# 
# DESCRIPTION
# 
#       Given a sentence file and (optionally) prerecorded audio files, produce a voice model in 
#       a specified location.  Indicate whether to record (-record) or import (-import) the 
#       audio files.
# 
# USAGE
# 
#       vmc.sh model-name [ -record OR -import audio/file/directory ] sentence-file output-folder [reps]
#
# DEPENDENCIES
# 
#       CMU Sphinx, Python 3 (& 2.7), Perl, and other misc. packages.
# 
# NOTES
# 
#       The output folder is intended to be the location of the voice model, once completed.
# 
#       The [reps] variable at the end specifies how many times to request a recording of each 
#       entry in the sentence file.  It is optional, as it is placed at the end of the list of 
#       parameters and the script will not fail if it is not specified.
# 
#       Having been installed to /usr/local/bin, this command can be called from anywhere.
# 

# VARIABLES =======================================================================================

export LD_LIBRARY_PATH=/usr/local/lib
        # set path to include sphinx library location 
        # https://jrmeyer.github.io/installation/2016/01/09/Installing-CMU-Sphinx-on-Ubuntu.html

if [[ $2 = '-record' ]]; then 

    sentence_file=$3
    output_folder=$4

    if [[ -z $5 ]]; then
        iterations=$5
    else
        iterations=1
    fi

elif [[ $2 = '-import' ]]; then

    audio_file_directory=$3
    sentence_file=$4
    output_folder=$5

else

    echo "USAGE: vmc.sh model-name [ -record OR -import audio/file/dir ] sentence-file output-folder [reps]"
    exit 1

fi

model_name=$1

audio_folder=$output_folder/audio

tdir=/opt/vmc/tools 

fdir=/opt/vmc/functions


# COMMANDS ========================================================================================

# OBTAIN REQUISITE FILES --------------------------------------------------------------------------

# get audio files
if [ $1 = '-record' ]; then 

    mkdir -p $audio_folder

    python3 $fdir/getaudio.py $sentence_file $audio_folder $iterations $model_name

elif [ $1 = '-import' ]; then

{'fraction_non_alphanumeric': 0.2069126576366184, 'fraction_numerical': 0.012143858010275572, 'mean_word_length': 2.714657415437988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '837940', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1234, 'n_words': 408}