yum-slop/TaSTT

Free self-hosted STT for VRChat.

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

yumAdd support for whisper large v3 turbo673d701

v0.21.0
4.1 KiB150 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
88if (-Not (Test-Path UwwwuPP)) {
89  git clone https://github.com/yum-food/UwwwuPP
90  pushd UwwwuPP > $null
91  git submodule update --init --recursive
92
93  mkdir build
94  pushd build > $null
95
96  cmake.exe ..
97  cmake.exe --build .
98
99  popd > $null
100  popd > $null
101}
102
103if (-Not (Test-Path Profanity)) {
104  mkdir Profanity
105  pushd Profanity > $null
106
107  $repo = "List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words"
108  git clone https://github.com/LDNOOBW/$repo
109
110  mkdir Profanity
111  cp $repo/LICENSE Profanity/
112  cp $repo/en Profanity/
113
114  echo "Source: https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words" > Profanity/AUTHOR
115
116  popd > $null
117}
118
119if (-Not (Test-Path "silero-vad")) {
120  git clone "https://github.com/snakers4/silero-vad"
121}
122
123mkdir $install_dir > $null
124mkdir $install_dir/Resources > $null
125cp -Recurse ../Animations TaSTT/Resources/Animations
126mkdir TaSTT/Resources/Fonts
127cp -Recurse ../Fonts/Bitmaps TaSTT/Resources/Fonts/Bitmaps
128cp -Recurse ../Fonts/Emotes TaSTT/Resources/Fonts/Emotes
129cp -Recurse Python TaSTT/Resources/Python
130cp -Recurse PortableGit TaSTT/Resources/PortableGit
131cp -Recurse ../Scripts TaSTT/Resources/Scripts
132mkdir TaSTT/Resources/Images
133cp ../Images/logo*.png TaSTT/Resources/Images/
134cp -Recurse ../Shaders TaSTT/Resources/Shaders
135cp -Recurse ../Sounds TaSTT/Resources/Sounds
136cp -Recurse ../UnityAssets TaSTT/Resources/UnityAssets
137cp -Recurse ../BrowserSource TaSTT/Resources/BrowserSource
138cp GUI/x64/$release/GUI.exe TaSTT/TaSTT.exe
139mkdir TaSTT/Resources/Models
140cp "silero-vad/files/silero_vad.onnx" TaSTT/Resources/Models/
141cp "silero-vad/LICENSE" TaSTT/Resources/Models/silero_vad.onnx.LICENSE
142mkdir TaSTT/Resources/Uwu
143cp UwwwuPP/build/Src/Debug/Uwwwu.exe TaSTT/Resources/Uwu/
144cp UwwwuPP/LICENSE TaSTT/Resources/Uwu/
145cp -r Profanity/Profanity TaSTT/Resources/Profanity
146
147if (-Not $skip_zip) {
148  Compress-Archive -Path "$install_dir" -DestinationPath "$install_dir.zip" -Force
149}
150