# Nanbeige4.3-33B lokal ausprobieren – Windows (PowerShell) # Automatisch erzeugt von Tokenstrom (tokenstrom.de). # Aufruf: powershell -ExecutionPolicy Bypass -File try_windows.ps1 # $env:MODE='hf'; powershell -ExecutionPolicy Bypass -File try_windows.ps1 (Python statt Ollama) $ErrorActionPreference = "Stop" Set-Location $PSScriptRoot Write-Host "== Nanbeige4.3-33B ==" if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) { nvidia-smi --query-gpu=name,memory.total --format=csv,noheader } if ($env:MODE -ne "hf") { Write-Host "== Ollama ==" if (-not (Get-Command ollama -ErrorAction SilentlyContinue)) { Write-Host "Ollama wird installiert ..." winget install -e --id Ollama.Ollama --accept-source-agreements --accept-package-agreements $env:Path = [Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [Environment]::GetEnvironmentVariable("Path","User") } try { Invoke-WebRequest -UseBasicParsing http://localhost:11434/api/tags | Out-Null } catch { Start-Process -WindowStyle Hidden ollama -ArgumentList "serve"; Start-Sleep 3 } if (-not $env:MODEL) { $env:MODEL = "hf.co/eepos/Nanbeige4.3-33B-Q4_K_S-GGUF" } Write-Host "Lade $($env:MODEL) herunter (beim ersten Mal dauert das je nach Größe einige Minuten) ..." ollama pull $env:MODEL Write-Host "" Write-Host "Fertig! Tippe jetzt deine Frage ein und drücke Enter. Beenden mit /bye" -ForegroundColor Green ollama run $env:MODEL exit } Write-Host "== Python / Hugging Face ==" python -m venv .venv-nanbeige4-3-33b & .\.venv-nanbeige4-3-33b\Scripts\Activate.ps1 python -m pip install -q -U pip if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) { pip install -q -U torch --index-url https://download.pytorch.org/whl/cu124 pip install -q -U transformers accelerate bitsandbytes } else { pip install -q -U torch transformers accelerate } python demo.py