在 Windows 上安装 Unsloth
查看在有或没有 WSL 的情况下如何在 Windows 上安装 Unsloth。
方法 #1 - Docker:
1
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
sudo apt-get update && sudo apt-get install -y \
nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}2
docker run -d -e JUPYTER_PASSWORD="mypassword" \
-p 8888:8888 -p 2222:22 \
-v $(pwd)/work:/workspace/work \
--gpus all \
unsloth/unsloth3
4
5
方法 #2 - WSL:
1
wsl.exe --install Ubuntu-24.04
wsl.exe -d Ubuntu-24.042
wsl3
sudo apt update
sudo apt install python3 python3-full python3-pip python3-venv -y4
pip install torch torchvision --force-reinstall --index-url https://download.pytorch.org/whl/cu1305
pip install unsloth jupyter6
jupyter notebook方法 #3 - 直接在 Windows 上:
1
2
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify ^
--installPath "C:\Program Files\Microsoft Visual Studio\2022\Community" ^
--add Microsoft.Net.Component.4.8.SDK ^
--add Microsoft.Net.Component.4.7.2.TargetingPack ^
--add Microsoft.VisualStudio.Component.Roslyn.Compiler ^
--add Microsoft.Component.MSBuild ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest ^
--add Microsoft.VisualStudio.Component.VC.CMake.Project ^
--add Microsoft.VisualStudio.Component.VC.CLI.Support ^
--add Microsoft.VisualStudio.Component.VC.Llvm.Clang ^
--add Microsoft.VisualStudio.ComponentGroup.ClangCL ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 ^
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^
--add Microsoft.VisualStudio.Component.UniversalCRT.SDK ^
--add Microsoft.VisualStudio.Component.VC.Redist.MSM3
4
5
pip install "unsloth[windows] @ git+https://github.com/unslothai/unsloth.git"注意
高级/故障排除
方法 #3 - 在 Windows 上使用 PowerShell:
第 1 步:安装先决条件
第 2 步:运行 Unsloth 安装脚本
第 3 步:使用 Unsloth
最后更新于
这有帮助吗?


