diff --git a/install.ps1 b/install.ps1 index 3d709ae1ff..f64021c629 100644 --- a/install.ps1 +++ b/install.ps1 @@ -87,6 +87,11 @@ function Install-UnslothStudio { ) if ($Code -eq 0) { $Code = 1 } Write-TauriLog "ERROR" $Message + # Clear the release-preservation handoff on any failure: a non-Tauri `irm | iex` + # run throws below and leaves the caller's session alive, so a leaked + # UNSLOTH_KEPT_TORCH would let a later `studio setup`/`update` (or a retry that + # skips the branch-entry clear) re-pin the abandoned exact torch release. + Remove-Item Env:UNSLOTH_KEPT_TORCH -ErrorAction SilentlyContinue if (Get-Command Restore-StudioVenvRollback -CommandType Function -ErrorAction SilentlyContinue) { Restore-StudioVenvRollback } diff --git a/tests/sh/test_torch_constraint.sh b/tests/sh/test_torch_constraint.sh index d36581987b..24e12787e2 100644 --- a/tests/sh/test_torch_constraint.sh +++ b/tests/sh/test_torch_constraint.sh @@ -115,7 +115,7 @@ assert_eq "\$TORCH_CONSTRAINT used in pip install" "yes" "$_has_var" # No stray hardcoded default ranges outside the ceiling-composed assignments # (the curated ROCm >=2.11 floors are deliberately literal). -_hardcoded=$(grep -c '"torch>=2.4,<2.11.0"\|"torch>=2.4,<2.12.0"' "$INSTALL_SH" || true) +_hardcoded=$(grep -E -c '"torch>=2.4,<2.11.0"|"torch>=2.4,<2.12.0"' "$INSTALL_SH" || true) assert_eq "no hardcoded default torch range remains" "0" "$_hardcoded" # Companions must be bounded to torch's window everywhere, never bare: torchaudio