diff --git a/backend/open_webui/routers/ollama.py b/backend/open_webui/routers/ollama.py index 346d49607..135359937 100644 --- a/backend/open_webui/routers/ollama.py +++ b/backend/open_webui/routers/ollama.py @@ -16,6 +16,8 @@ from urllib.parse import urlparse import aiohttp from aiocache import cached import requests + +from open_webui.models.chats import Chats from open_webui.models.users import UserModel from open_webui.env import ( @@ -151,8 +153,8 @@ async def send_post_request( if r.ok is False: try: res = await r.json() + await cleanup_response(r, session) if "error" in res: - log.error(f"Error from server: {res['error']}") raise HTTPException(status_code=r.status, detail=res["error"]) except HTTPException as e: raise e # Re-raise HTTPException to be handled by FastAPI diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 661c00206..229da0002 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1738,6 +1738,7 @@ history.messages[responseMessageId] = responseMessage; history.currentId = responseMessageId; + return null; });