diff --git a/.gitignore b/.gitignore index 9fe4cc40..43c32504 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ memo.txt *.pyc logs/ .venv/ +.venv_cuda/ weights/ .vscode error.log diff --git a/backend.spec b/backend.spec index 730cb9be..279a5a5a 100644 --- a/backend.spec +++ b/backend.spec @@ -5,7 +5,7 @@ a = Analysis( ['src-python\\webui_mainloop.py'], pathex=[], binaries=[], - datas=[('./fonts', 'fonts/'), ('.venv/Lib/site-packages/zeroconf', 'zeroconf/'), ('.venv/Lib/site-packages/openvr', 'openvr/'), ('.venv/Lib/site-packages/pykakasi', 'pykakasi/')], + datas=[('./fonts', 'fonts/'), ('.venv/Lib/site-packages/zeroconf', 'zeroconf/'), ('.venv/Lib/site-packages/openvr', 'openvr/'), ('.venv/Lib/site-packages/pykakasi', 'pykakasi/'), ('.venv/Lib/site-packages/faster_whisper', 'faster_whisper/')], hiddenimports=[], hookspath=[], hooksconfig={}, diff --git a/backend_cuda.spec b/backend_cuda.spec new file mode 100644 index 00000000..81fb5f7d --- /dev/null +++ b/backend_cuda.spec @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['src-python\\webui_mainloop.py'], + pathex=[], + binaries=[], + datas=[('./fonts', 'fonts/'), ('.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'), ('.venv_cuda/Lib/site-packages/openvr', 'openvr/'), ('.venv_cuda/Lib/site-packages/pykakasi', 'pykakasi/'), ('.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=['pandas', 'matplotlib', 'PyQt5'], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='backend-x86_64-pc-windows-msvc', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['src-ui\\assets\\chato_icon_fill.png'], +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='.', +) diff --git a/build.bat b/build.bat index b1e119f4..89ee8cbb 100644 --- a/build.bat +++ b/build.bat @@ -1,2 +1,2 @@ -pyinstaller --windowed --clean --noconfirm --icon="./img/vrct_logo_mark_black.ico" --add-data "./img;img/" --add-data "./fonts;fonts/" --add-data "./locales;locales/" --add-data "./batch;batch/" --name VRCT --add-data ".venv\Lib\site-packages\customtkinter;customtkinter/" --add-data ".venv\Lib\site-packages\zeroconf;zeroconf/" --add-data ".venv\Lib\site-packages\openvr;openvr/" --exclude-module pandas --exclude-module matplotlib --exclude-module PyQt5 main.py -"C:\Program Files (x86)\NSIS\makensis.exe" installer/installer.nsi \ No newline at end of file +call .venv/Scripts/activate +pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm \ No newline at end of file diff --git a/build_cuda.bat b/build_cuda.bat new file mode 100644 index 00000000..73c85676 --- /dev/null +++ b/build_cuda.bat @@ -0,0 +1,2 @@ +call .venv_cuda/Scripts/activate +pyinstaller backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm \ No newline at end of file diff --git a/install.bat b/install.bat index 8d2a5d51..03469d35 100644 --- a/install.bat +++ b/install.bat @@ -1,2 +1,10 @@ +python -m venv .venv +python -m venv .venv_cuda + +call .venv/Scripts/activate python.exe -m pip install --upgrade pip -pip install -r requirements.txt \ No newline at end of file +pip install -r requirements.txt + +call .venv_cuda/Scripts/activate +python.exe -m pip install --upgrade pip +pip install -r requirements_cuda.txt \ No newline at end of file diff --git a/package.json b/package.json index f353fcd1..ead0b180 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,18 @@ "type": "module", "scripts": { "setup-python": "install.bat", - "build-python": "pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm", + "build-python": "build.bat", + "build-python-cuda": "build_cuda.bat", "vite": "vite", "vite-build": "vite build", "vite-preview": "vite preview", "tauri": "tauri", "tauri-dev": "tauri dev", "dev": "npm run build-python && npm run dev-ui", + "dev-cuda": "npm run build-python-cuda && npm run dev-ui", "dev-ui": "npm-run-all --parallel vite tauri-dev", "build": "npm run build-python && npm run vite-build && npm run tauri build", + "build-cuda": "npm run build-python-cuda && npm run vite-build && npm run tauri build", "build-ui": "npm run vite-build && npm run tauri build" }, "dependencies": { diff --git a/requirements.txt b/requirements.txt index dbe35d50..bd049af7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,7 @@ +torch==2.2.2 +faster-whisper==1.0.3 +ctranslate2==4.3.1 +transformers==4.40.2 pillow == 10.0.0 PyAudioWPatch == 0.2.12.6 python-osc == 1.8.3 @@ -5,11 +9,7 @@ deepl == 1.15.0 flashtext ==2.7 pyinstaller==6.10.0 numpy==1.26.4 -torch==2.2.2 -transformers==4.37.2 sentencepiece==0.1.99 -ctranslate2==4.1.0 -faster-whisper==1.0.3 openvr==1.26.701 pydub==0.25.1 psutil==5.9.8 diff --git a/requirements_cuda.txt b/requirements_cuda.txt new file mode 100644 index 00000000..965dcaca --- /dev/null +++ b/requirements_cuda.txt @@ -0,0 +1,21 @@ +torch==2.2.2 +--extra-index-url https://download.pytorch.org/whl/cu121 +faster-whisper==1.0.3 +ctranslate2==4.3.1 +transformers==4.40.2 +pillow == 10.0.0 +PyAudioWPatch == 0.2.12.6 +python-osc == 1.8.3 +deepl == 1.15.0 +flashtext ==2.7 +pyinstaller==6.10.0 +numpy==1.26.4 +sentencepiece==0.1.99 +openvr==1.26.701 +pydub==0.25.1 +psutil==5.9.8 +pykakasi==2.3.0 +pycaw==20240210 +translators @ git+https://github.com/misyaguziya/translators@5.9.2.1 +SpeechRecognition @ git+https://github.com/misyaguziya/custom_speech_recognition@3.10.4.1 +tinyoscquery @ git+https://github.com/cyberkitsune/tinyoscquery@0.1.2 \ No newline at end of file