File size: 1,518 Bytes
33acd27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash

PYTHON_VERSION=3.10

# Check for required dependencies
dependencies=("python${PYTHON_VERSION}" "python${PYTHON_VERSION}-venv" "python${PYTHON_VERSION}-dev")
missing_dependencies=()

for dep in "${dependencies[@]}"; do
    if ! dpkg -s "$dep" &> /dev/null; then
        missing_dependencies+=("$dep")
    fi
done

if [ ${#missing_dependencies[@]} -gt 0 ]; then
    echo "Missing dependencies: ${missing_dependencies[*]}"
    echo "Please install them using 'sudo apt install ${missing_dependencies[*]}'"
    exit 1
fi

if python$PYTHON_VERSION --version &> /dev/null; then
    echo "Using Python version: $PYTHON_VERSION"
    if [ -f .env/ok ]; then
        source .env/bin/activate
    else
        echo "The environment is not ok. Running setup..."
        rm -rf .env
        python$PYTHON_VERSION -m venv .env && \
        source .env/bin/activate && \
        git submodule update --init --recursive && \
        cd TTS && \
        git fetch --tags && \
        git checkout 0.1.1 && \
        echo "Installing TTS..." && \
        pip install --use-deprecated=legacy-resolver -e . -q && \
        cd .. && \
        echo "Installing other requirements..." && \
        pip install -r requirements.txt -q && \
        echo "Downloading Japanese/Chinese tokenizer..." && \
        python -m unidic download
        touch .env/ok
    fi
    python vixtts_demo.py
else
    echo "Python version $PYTHON_VERSION is not installed. Please install it."
fi