yum-slop/TaSTT

Free self-hosted STT for VRChat.

git clone https://git.yummers.dev/yum-slop/TaSTT

yumUpgrade vendored CUDA to 12.5cc6b69f

v0.19.2
5.6 KiB184 linesraw
1param(
2  [switch]$skip_zip = $false,
3  [string]$release = "Release",
4  [string]$install_pip = $true
5)
6
7echo "Skip zip: $skip_zip"
8echo "Release: $release"
9echo "Install pip: $install_pip"
10
11$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
12
13$install_dir = "TaSTT"
14
15if (Test-Path $install_dir) {
16  rm -Recurse -Force $install_dir
17}
18
19$py_dir = "Python"
20
21if (Test-Path $py_dir) {
22  rm -Recurse $py_dir
23}
24if (-Not (Test-Path $py_dir)) {
25  echo "Fetching python"
26
27  $PYTHON_3_10_9_URL = "https://www.python.org/ftp/python/3.10.9/python-3.10.9-embed-amd64.zip"
28  $PYTHON_URL = $PYTHON_3_10_9_URL
29  $PYTHON_FILE = $(Split-Path -Path $PYTHON_URL -Leaf)
30
31  if (-Not (Test-Path $PYTHON_FILE)) {
32    Invoke-WebRequest $PYTHON_URL -OutFile $PYTHON_FILE
33  }
34
35  mkdir Python
36  Expand-Archive $PYTHON_FILE -DestinationPath Python
37
38  echo "../Scripts" >> Python/python310._pth
39  echo "import site" >> Python/python310._pth
40}
41
42$pip_path = "$py_dir/get-pip.py"
43
44if (Test-Path $pip_path) {
45  rm -Force $pip_path
46}
47
48if (-Not (Test-Path $pip_path)) {
49  echo "Fetching pip"
50
51  $PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
52  $PIP_FILE = $(Split-Path -Path $PIP_URL -Leaf)
53
54  if (-Not (Test-Path $PIP_FILE)) {
55    Invoke-WebRequest $PIP_URL -OutFile $PIP_FILE
56  }
57
58  mv $PIP_FILE $pip_path
59}
60
61if ($install_pip) {
62  ./Python/python.exe Python/get-pip.py
63
64  echo "Installing future"
65  echo "Assuming host has python 3.10.9 installed" # TODO test for this
66  python -m pip install future==0.18.2 --target Python/Lib/site-packages
67}
68
69$git_dir = "PortableGit"
70
71if (-Not (Test-Path $git_dir)) {
72  echo "Fetching PortableGit"
73
74  # When it's time to update this, get the latest version from here:
75  #   https://git-scm.com/download/win
76  $GIT_2_39_0_URL = "https://github.com/git-for-windows/git/releases/download/v2.39.0.windows.2/PortableGit-2.39.0.2-64-bit.7z.exe"
77  $GIT_URL = $GIT_2_39_0_URL
78  $GIT_FILE = $(Split-Path -Path $GIT_URL -Leaf)
79
80  if (-Not (Test-Path $GIT_FILE)) {
81    Invoke-WebRequest $GIT_URL -OutFile $GIT_FILE
82  }
83  & "./$GIT_FILE"
84
85  Read-Host -Prompt "Press enter once PortableGit is installed at $pwd\PortableGit"
86}
87
88$nvidia_dir = "nvidia_dll"
89
90if (-Not (Test-Path $nvidia_dir)) {
91  echo "Fetching CUDNN dependencies"
92
93  mkdir $nvidia_dir
94  pushd $nvidia_dir > $null
95
96  $ZLIB_URL = "https://drive.google.com/uc?export=download&id=1NpWU83JVOWG0tJtFK7ObygTbOasGWZpI"
97  Invoke-WebRequest $ZLIB_URL -OutFile "zlibwapi.dll"
98
99  # NVIDIA locks these files behind a fucking login making it a massive
100  # pain in the dick for end users to download, so I rehosted them.
101  # TODO check hashes.
102  echo "Fetching NVIDIA dll 1/4 (90 MB)"
103  $CUDNN_1_URL = "https://www.dropbox.com/scl/fi/d21dsoa982ce7wigng510/cudnn_ops_infer64_8.dll?rlkey=xflxyux0ekhr0fs11m4gs58md&st=0wff5fyn&dl=1"
104  Invoke-WebRequest $CUDNN_1_URL -OutFile "cudnn_ops_infer64_8.dll"
105
106  echo "Fetching NVIDIA dll 2/4 (570 MB)"
107  $CUDNN_2_URL = "https://www.dropbox.com/scl/fi/uqccevwk9h2q84dt9vr6u/cudnn_cnn_infer64_8.dll?rlkey=sik7xd0ozg06nr4eayzdym4la&st=031bb8pa&dl=1"
108  Invoke-WebRequest $CUDNN_2_URL -OutFile "cudnn_cnn_infer64_8.dll"
109
110  echo "Fetching NVIDIA dll 3/4 (470 MB)"
111  $CUBLAS_1_URL = "https://www.dropbox.com/scl/fi/3vrd4fzwno8q5ejigqz6l/cublasLt64_12.dll?rlkey=uvbdn5e7dmm8ajdhm7yztjmhc&st=dguf57q4&dl=1"
112  Invoke-WebRequest $CUBLAS_1_URL -OutFile "cublasLt64_12.dll"
113
114  echo "Fetching NVIDIA dll 4/4 (100 MB)"
115  $CUBLAS_2_URL = "https://www.dropbox.com/scl/fi/hoxjdru7qmwbzelw1gr2t/cublas64_12.dll?rlkey=mcmq5t0b62wjc2uc7ylrixwi6&st=z1la337w&dl=1"
116  Invoke-WebRequest $CUBLAS_2_URL -OutFile "cublas64_12.dll"
117
118  popd > $null
119}
120
121if (-Not (Test-Path UwwwuPP)) {
122  git clone https://github.com/yum-food/UwwwuPP
123  pushd UwwwuPP > $null
124  git submodule update --init --recursive
125
126  mkdir build
127  pushd build > $null
128
129  cmake.exe ..
130  cmake.exe --build .
131
132  popd > $null
133  popd > $null
134}
135
136if (-Not (Test-Path Profanity)) {
137  mkdir Profanity
138  pushd Profanity > $null
139
140  $repo = "List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words"
141  git clone https://github.com/LDNOOBW/$repo
142
143  mkdir Profanity
144  cp $repo/LICENSE Profanity/
145  cp $repo/en Profanity/
146
147  echo "Source: https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words" > Profanity/AUTHOR
148
149  popd > $null
150}
151
152if (-Not (Test-Path "silero-vad")) {
153  git clone "https://github.com/snakers4/silero-vad"
154}
155
156mkdir $install_dir > $null
157mkdir $install_dir/Resources > $null
158cp -Recurse ../Animations TaSTT/Resources/Animations
159mkdir TaSTT/Resources/Fonts
160cp -Recurse ../Fonts/Bitmaps TaSTT/Resources/Fonts/Bitmaps
161cp -Recurse ../Fonts/Emotes TaSTT/Resources/Fonts/Emotes
162cp -Recurse Python TaSTT/Resources/Python
163cp -Recurse PortableGit TaSTT/Resources/PortableGit
164cp -Recurse ../Scripts TaSTT/Resources/Scripts
165cp $nvidia_dir/*.dll TaSTT/Resources/Scripts/
166mkdir TaSTT/Resources/Images
167cp ../Images/logo*.png TaSTT/Resources/Images/
168cp -Recurse ../Shaders TaSTT/Resources/Shaders
169cp -Recurse ../Sounds TaSTT/Resources/Sounds
170cp -Recurse ../UnityAssets TaSTT/Resources/UnityAssets
171cp -Recurse ../BrowserSource TaSTT/Resources/BrowserSource
172cp GUI/x64/$release/GUI.exe TaSTT/TaSTT.exe
173mkdir TaSTT/Resources/Models
174cp "silero-vad/files/silero_vad.onnx" TaSTT/Resources/Models/
175cp "silero-vad/LICENSE" TaSTT/Resources/Models/silero_vad.onnx.LICENSE
176mkdir TaSTT/Resources/Uwu
177cp UwwwuPP/build/Src/Debug/Uwwwu.exe TaSTT/Resources/Uwu/
178cp UwwwuPP/LICENSE TaSTT/Resources/Uwu/
179cp -r Profanity/Profanity TaSTT/Resources/Profanity
180
181if (-Not $skip_zip) {
182  Compress-Archive -Path "$install_dir" -DestinationPath "$install_dir.zip" -Force
183}
184