diff options
| author | yum <yum.food.vr@gmail.com> | 2025-07-24 18:13:33 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-07-24 18:13:33 -0700 |
| commit | 9a699c784501ed0d3c62a3485c898a3794580c48 (patch) | |
| tree | 1201c51df23b87171fc9518706af96f0169d4387 | |
| parent | 8368883ca3c280d0e6b3b2b69c12ab76edead1fc (diff) | |
Switch to embedded python
| -rw-r--r-- | ui/index.js | 9 | ||||
| -rw-r--r-- | ui/package.json | 6 |
2 files changed, 7 insertions, 8 deletions
diff --git a/ui/index.js b/ui/index.js index e11e3aa..f166534 100644 --- a/ui/index.js +++ b/ui/index.js @@ -31,10 +31,9 @@ const REQUIRED_DLLS = [ 'cudnn_ops64_9.dll' ]; -// Helper function to get the correct Python executable from venv +// Helper function to get the correct Python executable from embedded python function getVenvPython() { - const venvPath = path.join(APP_ROOT, 'venv'); - const pythonPath = path.join(venvPath, 'Scripts', 'python.exe'); + const pythonPath = path.join(APP_ROOT, 'python', 'python.exe'); return pythonPath; } @@ -48,7 +47,7 @@ function sendPythonOutput(message, type = 'stdout') { // Helper function to create environment with DLL path function createPythonEnvironment() { const dllPath = path.join(APP_ROOT, 'dll'); - const binPath = path.join(APP_ROOT, 'venv', 'Scripts'); + const binPath = path.join(APP_ROOT, 'python', 'Scripts'); const env = {}; env.PATH = `${dllPath};${binPath}`; env.HF_HUB_DISABLE_SYMLINKS_WARNING = '1'; @@ -146,7 +145,7 @@ function setupProcessHandlers(process) { }); } -// Helper function to execute Python commands using venv +// Helper function to execute Python commands using embedded python function executePythonCommand(args, options = {}) { return new Promise((resolve, reject) => { const pythonPath = getVenvPython(); diff --git a/ui/package.json b/ui/package.json index efdfc1e..ce22dee 100644 --- a/ui/package.json +++ b/ui/package.json @@ -11,7 +11,7 @@ "dev": "concurrently \"npm run watch:css\" \"electron .\"", "test": "echo \"Error: no test specified\" && exit 1", "clean:meta": "node -e \"const fs=require('fs');const path=require('path');function deleteMeta(dir){fs.readdirSync(dir).forEach(f=>{const p=path.join(dir,f);if(f.endsWith('.meta'))fs.unlinkSync(p);else if(fs.statSync(p).isDirectory()&&!f.startsWith('.'))deleteMeta(p);})}deleteMeta('./node_modules')\"", - "prebuild": "node build_scripts/setup-empty-venv.js", + "prebuild": "node build_scripts/setup-embedded-python.js", "dist": "npm run prebuild && npm run clean:meta && npm run build:css && electron-builder", "dist:win": "npm run prebuild && npm run clean:meta && npm run build:css && electron-builder --win", "dist:portable": "npm run prebuild && npm run clean:meta && npm run build:css && electron-builder --win portable", @@ -50,8 +50,8 @@ "filter": ["**/*"] }, { - "from": "../venv_clean", - "to": "venv", + "from": "../python_embedded", + "to": "python", "filter": ["**/*"] }, { |
