Timothy Jaeryang Baek 4 months ago
parent
commit
59324a82e0
2 changed files with 4 additions and 1 deletions
  1. 3 1
      backend/open_webui/routers/ollama.py
  2. 1 0
      src/lib/components/chat/Chat.svelte

+ 3 - 1
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

+ 1 - 0
src/lib/components/chat/Chat.svelte

@@ -1738,6 +1738,7 @@
 
 			history.messages[responseMessageId] = responseMessage;
 			history.currentId = responseMessageId;
+
 			return null;
 		});