-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathsetup.cmd
46 lines (36 loc) · 993 Bytes
/
setup.cmd
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
:: Copyright (c) Microsoft Corporation.
:: Licensed under the MIT License.
@echo off
setlocal
set RECREATE=0
if "%1" == "--help" (
echo Usage: setup [^<directory^>] [--recreate]
echo Options:
echo ^<directory^>: The directory where the virtual environment will be created. Default is ./.venv
echo --recreate: If specified, the virtual environment will be recreated if it already exists.
exit /b -1
)
IF "%1" == "--recreate" (
set RECREATE=1
shift /1
)
IF "%1" == "" (
set DIR=%~dp0\.venv
) else (
set DIR=%1\py\whisperService
IF "%2" == "--recreate" (
set RECREATE=1
)
)
IF "%RECREATE%" == "1" (
IF EXIST "%DIR%" (
rmdir /s /q %DIR%
)
)
IF NOT EXIST "%DIR%\Scripts\activate" (
py -m venv %DIR%
call %DIR%\Scripts\activate.bat
pip config --site set global.extra-index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
)
endlocal && %DIR%\Scripts\activate.bat