|
|
|
@ -54,6 +54,16 @@ if [[ "$@" == *"--expose"* ]]; then
|
|
|
|
|
export SERVER_EXPOSE_PUBLICALLY="True"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Check if "--clear-local" is passed as an argument
|
|
|
|
|
if [[ "$@" == *"--clear-local"* ]]; then
|
|
|
|
|
# If "--clear-local" is passed, clear the contents of the folders in script_dir/01OS/server/{tts and stt}/local_service
|
|
|
|
|
echo "Clearing local services..."
|
|
|
|
|
rm -rf "$SCRIPT_DIR/01OS/server/tts/local_service"/*
|
|
|
|
|
rm -rf "$SCRIPT_DIR/01OS/server/stt/local_service"/*
|
|
|
|
|
echo "Exiting after clearing local services..."
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
### SETUP
|
|
|
|
|
|
|
|
|
|
if [[ "$ALL_LOCAL" == "True" ]]; then
|
|
|
|
@ -61,7 +71,6 @@ if [[ "$ALL_LOCAL" == "True" ]]; then
|
|
|
|
|
|
|
|
|
|
## WHISPER
|
|
|
|
|
|
|
|
|
|
WHISPER_MODEL_URL="https://huggingface.co/ggerganov/whisper.cpp/resolve/main/"
|
|
|
|
|
WHISPER_PATH="$SCRIPT_DIR/01OS/server/stt/local_service"
|
|
|
|
|
if [[ ! -f "${WHISPER_PATH}/${WHISPER_MODEL_NAME}" ]]; then
|
|
|
|
|
mkdir -p "${WHISPER_PATH}"
|
|
|
|
@ -70,10 +79,10 @@ if [[ "$ALL_LOCAL" == "True" ]]; then
|
|
|
|
|
|
|
|
|
|
## PIPER
|
|
|
|
|
|
|
|
|
|
PIPER_FILE_PATH="$SCRIPT_DIR/01OS/server/tts/local_service${PIPER_URL}${PIPER_ASSETNAME}"
|
|
|
|
|
if [[ ! -f "$PIPER_FILE_PATH" ]]; then
|
|
|
|
|
PIPER_FOLDER_PATH="$SCRIPT_DIR/01OS/server/tts/local_service"
|
|
|
|
|
if [[ ! -f "$PIPER_FOLDER_PATH" ]]; then
|
|
|
|
|
|
|
|
|
|
mkdir -p "${PIPER_FILE_PATH}"
|
|
|
|
|
mkdir -p "${PIPER_FOLDER_PATH}"
|
|
|
|
|
|
|
|
|
|
OS=$(uname -s)
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
@ -94,7 +103,7 @@ if [[ "$ALL_LOCAL" == "True" ]]; then
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
|
|
# Navigate to SCRIPT_DIR/01OS/server/tts/local_service
|
|
|
|
|
cd $SCRIPT_DIR/01OS/server/tts/local_service
|
|
|
|
|
cd ${PIPER_FOLDER_PATH}
|
|
|
|
|
|
|
|
|
|
curl -L "${PIPER_URL}${PIPER_ASSETNAME}" -o "${PIPER_ASSETNAME}"
|
|
|
|
|
tar -xvzf $PIPER_ASSETNAME
|
|
|
|
|