From 1e75614505b03c54df4cc9e50e475ecb670ba066 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:01:22 +0200 Subject: [PATCH] fix: a model downloaded by URL in Manage Ollama can reach Ollama with the end of the file missing (#31974) When a model file was downloaded by URL in Manage Ollama, the end of the file could still be on its way to disk when Open WebUI sent it to Ollama, so Ollama got a cut-off copy. The download is now fully on disk before it is sent, so Ollama gets the whole file. Fixes #31956 --- backend/open_webui/routers/ollama.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/open_webui/routers/ollama.py b/backend/open_webui/routers/ollama.py index 7af67756cd..fd5bf331af 100644 --- a/backend/open_webui/routers/ollama.py +++ b/backend/open_webui/routers/ollama.py @@ -1615,6 +1615,7 @@ async def download_file_stream( progress = round((current_size / progress_total) * 100, 2) yield f'data: {{"progress": {progress}, "completed": {current_size}, "total": {total_size}}}\n\n' + await f.flush() done = True hashed = await asyncio.to_thread(calculate_sha256, file_path, chunk_size)