| <# | |
| Attempt to install FAISS for CPU. Prefer conda if available because FAISS wheels | |
| on Windows are often easier via conda. Falls back to pip where possible. | |
| Usage: | |
| .\scripts\install_faiss.ps1 | |
| #> | |
| Write-Host "Checking for conda..." | |
| if (Get-Command conda -ErrorAction SilentlyContinue) { | |
| Write-Host "Using conda to install faiss-cpu" | |
| conda install -c pytorch faiss-cpu -y | |
| exit 0 | |
| } | |
| Write-Host "Conda not found, trying pip install faiss-cpu (may fail on Windows)." | |
| if (-not (Get-Command python -ErrorAction SilentlyContinue)) { | |
| Write-Error "Python not found on PATH. Activate your venv first."; exit 1 | |
| } | |
| python -m pip install faiss-cpu | |