Skip to content

Instantly share code, notes, and snippets.

@limcheekin
Last active September 22, 2025 09:48
Show Gist options
  • Select an option

  • Save limcheekin/8894cca80ffc2e6bcc0136ee0cff7fa2 to your computer and use it in GitHub Desktop.

Select an option

Save limcheekin/8894cca80ffc2e6bcc0136ee0cff7fa2 to your computer and use it in GitHub Desktop.
Bash script to start FastWhisperAPI
#!/bin/bash
# Check if conda environment is activated
if [[ "$CONDA_PREFIX" != "$(pwd)/.conda" ]]; then
echo "Activating conda environment..."
# Initialize conda for this shell if not already
if ! command -v conda &> /dev/null; then
echo "conda not found in PATH. Make sure Conda is installed and initialized."
exit 1
fi
eval "$(conda shell.bash hook)"
conda activate "$(pwd)/.conda"
else
echo "Conda environment already activated."
fi
FORCE_CPU=true fastapi run main.py --port 8882
#!/bin/bash
# Check if the virtual environment is activated
if [[ -z "$VIRTUAL_ENV" ]]; then
echo "Activating virtual environment..."
source .venv/bin/activate
else
echo "Virtual environment already activated."
fi
FORCE_CPU=true fastapi run main.py --port 8882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment