fix: num_ctx 16384 en el modelo (el 4096 da 400 en Open WebUI)

El primer mensaje con plantilla del sistema (~7k tokens) excedia el
contexto default de 4096 -> 400 exceed_context_size. Tras el import HF
y tras el pull del registry, re-crea el tag con PARAMETER num_ctx 16384
(FROM hereda pesos; verificado con ollama show: num_ctx 16384).
This commit is contained in:
hermes committed 2026-09-12 21:19:18 +02:00
1 parent 350d55c434
commit 99f0e847d9
4 files changed
+24 -8

No files matched your search

+6 -2
View File
@@ -194,7 +194,7 @@ foreach ($Url in $HfUrls) {
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-wp-ollama:/root/.ollama/import.gguf
docker exec d0a1-wp-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
docker exec d0a1-wp-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-wp-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
@@ -204,7 +204,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
# Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true }
if ($LASTEXITCODE -eq 0) {
$PullOk = $true
# Contexto ampliado (el default 4096 da 400 en Open WebUI con prompts largos)
docker exec d0a1-wp-ollama sh -c 'printf "FROM llama3.2:3b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
}
}
if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'