在 Windows 上安装 Unsloth
查看如何在 Windows 上安装 Unsloth 以开始在本地微调 LLM。
方法 #1 - 通过 Conda 在 Windows 上:
1


Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile ".\miniconda.exe"
Start-Process -FilePath ".\miniconda.exe" -ArgumentList "/S" -Wait
del .\miniconda.exe



2
conda create --name unsloth_env python==3.12 -y
conda activate unsloth_env
3

4
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
import torch
print(torch.cuda.is_available())
A = torch.ones((10, 10), device = "cuda")
B = torch.ones((10, 10), device = "cuda")
A @ B
5
pip install unsloth6
🦥 Unsloth:将对您的计算机进行补丁以实现 2 倍更快的免费微调。
🦥 Unsloth Zoo 现在将补丁所有内容以加速训练!
==((====))== Unsloth 2026.1.4:快速 Gemma3 补丁。Transformers:4.57.6。
\\ /| NVIDIA GeForce RTX 3060。GPU 数量 = 1。最大内存:12.0 GB。平台:Windows。
O^O/ \_/ \ Torch:2.10.0+cu130。CUDA:8.6。CUDA 工具包:13.0。Triton:3.6.0
\ / Bfloat16 = TRUE。FA [Xformers = 0.0.34。FA2 = False]
"-____-" 免费许可:https://github.com/unslothai/unsloth
Unsloth:已启用快速下载 - 忽略红色的下载条!
Unsloth:Gemma3 不支持 SDPA - 切换到快速 eager。
Unsloth:使 `model.base_model.model.model` 需要梯度
Unsloth:正在对 ["text"] 进行分词 (num_proc=1): 0%| | 0/210289 [00:00<?, ? 示例/秒]� Unsloth:将对您的计算机进行补丁以实现 2 倍更快的免费微调。
🦥 Unsloth:将对您的计算机进行补丁以实现 2 倍更快的免费微调。
方法 #2 - 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
方法 #3 - 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高级 对于
最后更新于
这有帮助吗?


