microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
python/tts/speechT5/setup.cmd
46lines · modecode
| 1 | :: Copyright (c) Microsoft Corporation. |
| 2 | :: Licensed under the MIT License. |
| 3 | |
| 4 | @echo off |
| 5 | |
| 6 | setlocal |
| 7 | set RECREATE=0 |
| 8 | |
| 9 | if "%1" == "--help" ( |
| 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 | exit /b -1 |
| 15 | ) |
| 16 | |
| 17 | IF "%1" == "--recreate" ( |
| 18 | set RECREATE=1 |
| 19 | shift /1 |
| 20 | ) |
| 21 | |
| 22 | IF "%1" == "" ( |
| 23 | set DIR=%~dp0\.venv |
| 24 | ) else ( |
| 25 | set DIR=%1\py\whisperService |
| 26 | |
| 27 | IF "%2" == "--recreate" ( |
| 28 | set RECREATE=1 |
| 29 | ) |
| 30 | ) |
| 31 | |
| 32 | IF "%RECREATE%" == "1" ( |
| 33 | IF EXIST "%DIR%" ( |
| 34 | rmdir /s /q %DIR% |
| 35 | ) |
| 36 | ) |
| 37 | |
| 38 | |
| 39 | IF NOT EXIST "%DIR%\Scripts\activate" ( |
| 40 | py -m venv %DIR% |
| 41 | call %DIR%\Scripts\activate.bat |
| 42 | pip config --site set global.extra-index-url https://download.pytorch.org/whl/cu121 |
| 43 | pip install -r requirements.txt |
| 44 | ) |
| 45 | |
| 46 | endlocal && %DIR%\Scripts\activate.bat |
| 47 | |