# setup-model.ps1
# Hugging Face から EmbeddingGemma-300m の GGUF モデルをダウンロードするスクリプト
$ModelUrl = "https://huggingface.co/abhijithmallya/embeddinggemma-300m-Q4_0-GGUF/resolve/main/embeddinggemma-300m-q4_0.gguf"
$TargetDir = Join-Path $PSScriptRoot "../models"
$TargetFile = Join-Path $TargetDir "embeddinggemma-300m-q4_0.gguf"
if (!(Test-Path $TargetDir)) {
New-Item -ItemType Directory -Path $TargetDir -Force
}
if (Test-Path $TargetFile) {
Write-Host "Model already exists at $TargetFile" -ForegroundColor Yellow
exit 0
}
Write-Host "Downloading EmbeddingGemma-300m model from Hugging Face..." -ForegroundColor Cyan
Write-Host "URL: $ModelUrl"
Write-Host "This may take a few minutes (approx. 200MB)..."
try {
Invoke-WebRequest -Uri $ModelUrl -OutFile $TargetFile -ErrorAction Stop
Write-Host "Successfully downloaded to $TargetFile" -ForegroundColor Green
}
catch {
Write-Error "Failed to download model: $_"
exit 1
}