microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
python/tts/speechT5/setup.sh
48lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | # This file must be used with "source setup.sh" *from bash* |
| 5 | # you cannot run it directly |
| 6 | |
| 7 | RECREATE=0 |
| 8 | |
| 9 | if [ "$1" = "--help" ]; then |
| 10 | echo "Usage: setup [<directory>] [--recreate]" |
| 11 | echo "Options:" |
| 12 | echo " <directory>: The directory where the virtual environment will be created. Default is ./.venv" |
| 13 | echo " --recreate: If specified, the virtual environment will be recreated if it already exists." |
| 14 | return |
| 15 | fi |
| 16 | |
| 17 | if [ "$1" = "--recreate" ]; then |
| 18 | RECREATE=1 |
| 19 | shift |
| 20 | fi |
| 21 | |
| 22 | if [ "$1" = "" ]; then |
| 23 | DIR=./.venv |
| 24 | else |
| 25 | DIR=$1/.venv |
| 26 | |
| 27 | if [ "$2" = "--recreate" ]; then |
| 28 | RECREATE=1 |
| 29 | fi |
| 30 | fi |
| 31 | |
| 32 | |
| 33 | if [ $RECREATE = 1 ]; then |
| 34 | if [ -d $DIR ]; then |
| 35 | rm -rf $DIR |
| 36 | fi |
| 37 | fi |
| 38 | |
| 39 | if [ ! -f $DIR/bin/activate ]; then |
| 40 | python3 -m venv $DIR |
| 41 | source $DIR/bin/activate |
| 42 | pip config --site set global.extra-index-url https://download.pytorch.org/whl/cu121 |
| 43 | pip install -r requirements.txt |
| 44 | else |
| 45 | source $DIR/bin/activate |
| 46 | fi |
| 47 | |
| 48 | |
| 49 | |