Solutions for common Windows-specific issues with ModelForge.
Problem: "Unsloth is not installed" or import errors on native Windows
Cause: Unsloth requires Linux-specific libraries and compilation
Solutions:
- Use WSL 2 (Recommended): WSL Installation Guide
- Use Docker: Docker Installation Guide
- Use HuggingFace Provider: Works perfectly on native Windows
The CLI wizard (modelforge cli) works on native Windows — no WSL needed. Only the Unsloth provider requires WSL or Docker.
pip install modelforge-finetuning[cli]
modelforge cliProblem: nvidia-smi works in Windows but not in WSL
Solutions:
- Update Windows to latest version (Build 21H2 or later)
- Update NVIDIA drivers to 525.60 or newer
- Ensure WSL 2 is installed:
wsl --status - Restart WSL:
Then reopen Ubuntu
wsl --shutdown
Problem: nvcc: command not found in WSL
Solution: Install CUDA Toolkit in WSL (not Windows):
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-toolkit-12-6Problem: Docker container can't access GPU
Solutions:
- Ensure WSL 2 backend is enabled in Docker Desktop
- Install nvidia-container-toolkit in WSL:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update sudo apt-get install -y nvidia-container-toolkit
- Restart Docker Desktop
Problem: Dockerfile build errors
Solution: Ensure WSL integration is enabled:
- Docker Desktop → Settings → Resources → WSL Integration
- Enable integration for Ubuntu distribution
- Restart Docker Desktop
Problem: Cannot create files/directories
Solutions:
In WSL:
sudo chown -R $USER:$USER ~/ModelForgeIn Windows: Run PowerShell as Administrator
Problem: modelforge command not found
Solutions:
In PowerShell:
# Add to PATH
$env:PATH += ";$env:USERPROFILE\AppData\Local\Programs\Python\Python311\Scripts"In WSL:
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrcProblem: Token not found despite setting
Solutions:
PowerShell (Session):
$env:HUGGINGFACE_TOKEN="your_token"PowerShell (Permanent):
[System.Environment]::SetEnvironmentVariable('HUGGINGFACE_TOKEN', 'your_token', 'User')CMD:
setx HUGGINGFACE_TOKEN "your_token"Restart terminal after setting permanent variables.
Solutions:
- Use WSL instead of native Windows (better I/O performance)
- Install dataset on NVMe SSD
- Disable Windows Defender for project folder
- Close unnecessary Windows applications
Solutions:
- Limit Windows background processes
- Disable Windows Search indexing for project folder
- Use WSL for better resource management
Problem: JSONL files have wrong line endings
Solution: Convert CRLF to LF:
(Get-Content dataset.jsonl) | Set-Content dataset.jsonlProblem: Paths with backslashes don't work
Solution: Use forward slashes or raw strings:
# Good
path = "C:/Users/username/dataset.jsonl"
path = r"C:\Users\username\dataset.jsonl"
# Bad
path = "C:\Users\username\dataset.jsonl" # Escaping issuesProblem: "File path too long" errors
Solution: Enable long paths in Windows:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -ForceRestart computer.
Solution: Add exception:
- Windows Security → Virus & threat protection → Manage settings
- Add exclusion for ModelForge folder
Solution: Add firewall rule:
New-NetFirewallRule -DisplayName "ModelForge" -Direction Inbound -LocalPort 8000 -Protocol TCP -Action AllowSolution: Install Visual C++ Redistributable: Download from Microsoft
Solutions:
- Install Visual C++ Redistributable
- Update Windows
- Reinstall Python
Solutions:
- Run PowerShell as Administrator
- Check folder permissions
- Disable antivirus temporarily
Solution: Configure WSL memory limit in .wslconfig:
Create C:\Users\<username>\.wslconfig:
[wsl2]
memory=16GB
processors=8
swap=8GBRestart WSL:
wsl --shutdownAccess WSL from Windows:
\\wsl$\Ubuntu-22.04\home\username\
Access Windows from WSL:
/mnt/c/Users/username/
Windows-specific issue not listed? Ask in GitHub Discussions.