tabbyAPI-ollama/start.sh
kingbri 3c8384ee71 Start: Fix startup with new argparser
Since the full argparser requires pydantic, gate it until all dependencies
are installed.

Also if the venv is deleted, assume that start_options.json is invalid
as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-09-21 14:36:21 -04:00

24 lines
543 B
Bash
Executable file

#!/bin/bash
cd "$(dirname "$0")" || exit
if [ -n "$CONDA_PREFIX" ]; then
echo "It looks like you're in a conda environment. Skipping venv check."
else
if [ ! -d "venv" ]; then
echo "Venv doesn't exist! Creating one for you."
python3 -m venv venv
if [ -f "start_options.json" ]; then
echo "Removing old start_options.json"
rm -rf start_options.json
fi
fi
echo "Activating venv"
# shellcheck source=/dev/null
source venv/bin/activate
fi
python3 start.py "$@"