Check if installed

pull/56/head
Ty Fiero 11 months ago
parent 3b9278f656
commit 977607c8c9

@ -91,44 +91,45 @@ OI_SKILLS_PATH="$SCRIPT_DIR/01OS/server/skills"
### SETUP ### SETUP
if [[ "$ALL_LOCAL" == "True" ]]; then if [[ "$ALL_LOCAL" == "True" ]]; then
# if using local models, install the models / executables # if using local models, install the models / executables
## WHISPER
CWD=$(pwd) CWD=$(pwd)
# Whisper setup
STT_PATH="$SCRIPT_DIR/01OS/server/stt" STT_PATH="$SCRIPT_DIR/01OS/server/stt"
WHISPER_RUST_PATH="${STT_PATH}/whisper-rust" WHISPER_RUST_PATH="${STT_PATH}/whisper-rust"
cd ${WHISPER_RUST_PATH} cd ${WHISPER_RUST_PATH}
# Check if whisper-rust executable exists # Check if whisper-rust executable exists before attempting to build
if [[ ! -f "${WHISPER_RUST_PATH}/target/release/whisper-rust" ]]; then if [[ ! -f "${WHISPER_RUST_PATH}/target/release/whisper-rust" ]]; then
# Check if Rust is installed. Needed to build whisper executable # Check if Rust is installed. Needed to build whisper executable
if ! command -v rustc &> /dev/null; then if ! command -v rustc &> /dev/null; then
echo "Rust is not installed or is not in system PATH. Please install Rust before proceeding." echo "Rust is not installed or is not in system PATH. Please install Rust before proceeding."
exit 1 exit 1
fi fi
# Build Whisper Rust executable if not found
# Build the Whisper Rust executable
cargo build --release cargo build --release
else
echo "Whisper Rust executable already exists. Skipping build."
fi fi
WHISPER_MODEL_PATH="${STT_PATH}/local_service" WHISPER_MODEL_PATH="${STT_PATH}/local_service"
if [[ ! -f "${WHISPER_MODEL_PATH}/${WHISPER_MODEL_NAME}" ]]; then if [[ ! -f "${WHISPER_MODEL_PATH}/${WHISPER_MODEL_NAME}" ]]; then
mkdir -p "${WHISPER_MODEL_PATH}" mkdir -p "${WHISPER_MODEL_PATH}"
curl -L "${WHISPER_MODEL_URL}${WHISPER_MODEL_NAME}" -o "${WHISPER_MODEL_PATH}/${WHISPER_MODEL_NAME}" curl -L "${WHISPER_MODEL_URL}${WHISPER_MODEL_NAME}" -o "${WHISPER_MODEL_PATH}/${WHISPER_MODEL_NAME}"
else
echo "Whisper model already exists. Skipping download."
fi fi
cd $CWD cd $CWD
## PIPER ## PIPER
PIPER_FOLDER_PATH="$SCRIPT_DIR/01OS/server/tts/local_service" PIPER_FOLDER_PATH="$SCRIPT_DIR/01OS/server/tts/local_service"
if [[ ! -f "$PIPER_FOLDER_PATH" ]]; then if [[ ! -d "$PIPER_FOLDER_PATH/piper" ]]; then # Check if the Piper directory exists
mkdir -p "${PIPER_FOLDER_PATH}" mkdir -p "${PIPER_FOLDER_PATH}"
# Determine OS and architecture
OS=$(uname -s) OS=$(uname -s)
ARCH=$(uname -m) ARCH=$(uname -m)
if [ "$OS" = "Darwin" ]; then if [ "$OS" = "Darwin" ]; then
@ -149,12 +150,12 @@ if [[ "$ALL_LOCAL" == "True" ]]; then
# Navigate to SCRIPT_DIR/01OS/server/tts/local_service # Navigate to SCRIPT_DIR/01OS/server/tts/local_service
cd ${PIPER_FOLDER_PATH} cd ${PIPER_FOLDER_PATH}
curl -L "${PIPER_URL}${PIPER_ASSETNAME}" -o "${PIPER_ASSETNAME}" curl -L "${PIPER_URL}${PIPER_ASSETNAME}" -o "${PIPER_ASSETNAME}"
tar -xvzf $PIPER_ASSETNAME tar -xvzf $PIPER_ASSETNAME
cd piper cd piper
curl -OL "${PIPER_VOICE_URL}${PIPER_VOICE_NAME}" curl -OL "${PIPER_VOICE_URL}${PIPER_VOICE_NAME}"
curl -OL "${PIPER_VOICE_URL}${PIPER_VOICE_NAME}.json" curl -OL "${PIPER_VOICE_URL}${PIPER_VOICE_NAME}.json"
# Additional setup for macOS
if [ "$OS" = "macos" ]; then if [ "$OS" = "macos" ]; then
if [ "$ARCH" = "x64" ]; then if [ "$ARCH" = "x64" ]; then
softwareupdate --install-rosetta --agree-to-license softwareupdate --install-rosetta --agree-to-license
@ -169,8 +170,11 @@ if [[ "$ALL_LOCAL" == "True" ]]; then
install_name_tool -change @rpath/libpiper_phonemize.1.dylib "${PIPER_DIR}/piper-phonemize/lib/libpiper_phonemize.1.dylib" "${PIPER_DIR}/piper" install_name_tool -change @rpath/libpiper_phonemize.1.dylib "${PIPER_DIR}/piper-phonemize/lib/libpiper_phonemize.1.dylib" "${PIPER_DIR}/piper"
fi fi
echo "Piper setup completed."
# Navigate back to the current working directory # Navigate back to the current working directory
cd $CWD cd $CWD
else
echo "Piper already set up. Skipping download."
fi fi
fi fi

Loading…
Cancel
Save