Revert "feat(multimodal): 补齐阶段F运行管理与收尾验收"

This reverts commit 64f63ff1bd.
This commit is contained in:
2026-09-05 02:02:26 +08:00
parent f697364aaf
commit 510936431a
29 changed files with 84 additions and 838 deletions
+3 -6
View File
@@ -1,10 +1,9 @@
param(
[ValidateSet('cpu', 'cuda')][string]$Device = 'cpu',
[string]$RuntimeDirectory = ''
[ValidateSet('cpu', 'cuda')][string]$Device = 'cpu'
)
$ErrorActionPreference = 'Stop'
$backendRoot = Split-Path $PSScriptRoot -Parent
$runtimeRoot = if ($RuntimeDirectory) { [IO.Path]::GetFullPath($RuntimeDirectory) } else { Join-Path $backendRoot '.venv-models' }
$runtimeRoot = Join-Path $backendRoot '.venv-models'
$runtimePython = Join-Path $runtimeRoot 'Scripts/python.exe'
if (!(Test-Path -LiteralPath $runtimePython)) {
& uv venv --python 3.12 $runtimeRoot
@@ -12,9 +11,7 @@ if (!(Test-Path -LiteralPath $runtimePython)) {
}
# CPU is the default. CUDA wheels include the runtime, not the NVIDIA driver.
$torchIndex = if ($Device -eq 'cuda') { 'https://download.pytorch.org/whl/cu128' } else { 'https://download.pytorch.org/whl/cpu' }
$wheelVariant = if ($Device -eq 'cuda') { 'cu128' } else { 'cpu' }
# Pin the local version too: ==2.9.1 alone also accepts an already-installed CPU wheel.
& uv pip install --python $runtimePython --index-url $torchIndex "torch==2.9.1+$wheelVariant" "torchaudio==2.9.1+$wheelVariant"
& uv pip install --python $runtimePython --index-url $torchIndex 'torch==2.9.1' 'torchaudio==2.9.1'
if ($LASTEXITCODE -ne 0) { throw 'PyTorch 安装失败' }
& uv pip install --python $runtimePython -r (Join-Path $PSScriptRoot 'model-requirements.lock') -c (Join-Path $PSScriptRoot 'model-requirements.txt')
if ($LASTEXITCODE -ne 0) { throw '模型依赖安装失败' }