Enhance FastEmbed Integration and GPU Management

- Updated Windows platform guidelines for path formats and Bash rules.
- Refactored CodexLens routes to improve GPU detection and indexing cancellation logic.
- Added FastEmbed installation status handling in the dashboard, including UI updates for installation and reinstallation options.
- Implemented local model management with improved API responses for downloaded models.
- Enhanced GPU selection logic in the model mode configuration.
- Improved error handling and user feedback for FastEmbed installation processes.
- Adjusted Python environment checks to avoid shell escaping issues on Windows.
This commit is contained in:
catlog22
2026-01-06 14:42:00 +08:00
parent 08099cdcb9
commit 6cb819cb3a
6 changed files with 659 additions and 100 deletions

View File

@@ -389,7 +389,8 @@ async function checkPythonEnvForDirectML(): Promise<PythonEnvInfo> {
try {
// Get Python version and architecture in one call
const checkScript = `import sys, struct; print(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}|{struct.calcsize('P') * 8}")`;
// Use % formatting instead of f-string to avoid Windows shell escaping issues with curly braces
const checkScript = `import sys, struct; print('%d.%d.%d|%d' % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro, struct.calcsize('P') * 8))`;
const result = execSync(`"${pythonPath}" -c "${checkScript}"`, { encoding: 'utf-8', timeout: 10000 }).trim();
const [version, archStr] = result.split('|');
const architecture = parseInt(archStr, 10);