Skip to content
Snippets Groups Projects
Commit 31df0f62 authored by Kian Rajabi's avatar Kian Rajabi
Browse files

Update file init_servers.sh

parents
Branches
No related tags found
No related merge requests found
#!/bin/bash
# Define the paths to your virtual environments
PGPT_ENV_PATH="$HOME/.venvs/privategpt"
AUDIO_SERVER_ENV_PATH="$HOME/.venvs/tts_stt_server"
# Define the working directories
PGPT_WORKING_DIR="$HOME/private-gpt"
AUDIO_SERVER_WORKING_DIR="$HOME/speakingLlama"
# Check if too many arguments were provided
if [ "$#" -gt 1 ]; then
echo "Error: Too many arguments. Usage: $0 [de] for german or no argument for english."
exit 1
fi
# Check if an argument was provided and if it's invalid
if [ -n "$1" ] && [ "$1" != "de" ]; then
echo "Error: Invalid argument. Usage: $0 [de] for german or no argument for english."
exit 1
fi
# Store the argument (if any)
ARG="$1"
# Start the first server (PGPT) in a separate terminal
gnome-terminal -- bash -c "
cd \"$PGPT_WORKING_DIR\" || exit 1;
source \"$PGPT_ENV_PATH/bin/activate\";
if [ \"$ARG\" == \"de\" ]; then
PGPT_PROFILES=german make run;
else
PGPT_PROFILES=local make run;
fi
exec bash" &
# Start the second server (AUDIO SERVER) in a separate terminal
gnome-terminal -- bash -c "
cd \"$AUDIO_SERVER_WORKING_DIR\" || exit 1;
source \"$AUDIO_SERVER_ENV_PATH/bin/activate\";
if [ \"$ARG\" == \"de\" ]; then
export AUDIO_SERVER_LANG=de
else
export AUDIO_SERVER_LANG=en;
fi
flask --app audio_server run;
exec bash" &
~
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment