#!/bin/bash

# Define the system installation paths
INSTALL_DIR="/opt/fuss-speechtotext"
LIB_DIR="$INSTALL_DIR/lib"

# Direct the Linux linker to the location of C++ shared libraries (.so).
# This allows binary extensions to find their dependencies in the ctranslate2.libs folder.
export LD_LIBRARY_PATH="$LIB_DIR/ctranslate2.libs:$LD_LIBRARY_PATH"

# Add the application library directory to the Python module search path.
export PYTHONPATH="$LIB_DIR:$PYTHONPATH"

# Launch the application using the system Python interpreter.
# The "$@" preserves all command-line arguments passed to the script.
exec /usr/bin/python3 "$INSTALL_DIR/main.py" "$@"
