From 8ed9cf5c0dcb70d7ad957bbac3ec29a326ddc7bd Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Thu, 30 Nov 2023 01:38:25 +0100 Subject: [PATCH] Fixed cors problem --- app.py | 3 ++- lollms_core | 2 +- utilities/safe_store | 2 +- web/src/main.js | 12 +++++++++--- zoos/bindings_zoo | 2 +- zoos/personalities_zoo | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index f6e0be17..74c7f80a 100644 --- a/app.py +++ b/app.py @@ -65,7 +65,7 @@ try: from lollms.paths import LollmsPaths, gptqlora_repo from lollms.extension import LOLLMSExtension, ExtensionBuilder - + from flask_cors import CORS from api.db import Discussion from flask import ( Flask, @@ -149,6 +149,7 @@ try: log.setLevel(logging.ERROR) app = Flask("Lollms-WebUI", static_url_path="/static", static_folder="static") + CORS(app) from flask_compress import Compress # async_mode='gevent', ping_timeout=1200, ping_interval=120, socketio = SocketIO(app, cors_allowed_origins="*", async_mode='gevent', ping_timeout=1200, ping_interval=120) diff --git a/lollms_core b/lollms_core index 504c9362..14897de8 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 504c9362887fdaf7d656543e6078f8b3c1be1268 +Subproject commit 14897de85a2b53d0064d6341baf2b2b2e8164cb9 diff --git a/utilities/safe_store b/utilities/safe_store index 9c67a1e1..a33dc501 160000 --- a/utilities/safe_store +++ b/utilities/safe_store @@ -1 +1 @@ -Subproject commit 9c67a1e14704b361dfa4b0b950c72bdf6fa00cb7 +Subproject commit a33dc5014bfc12a012d063068482f53c1168a14b diff --git a/web/src/main.js b/web/src/main.js index 4257a395..29263e99 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -166,9 +166,15 @@ export const store = createStore({ }, actions: { async getVersion(){ - let res = await axios.get('/get_lollms_webui_version', {}); - if (res) { - this.state.version = res.data.version + try{ + let res = await axios.get('/get_lollms_webui_version', {}); + if (res) { + this.state.version = res.data.version + } + + } + catch{ + console.log("Coudln't get version") } }, async refreshConfig({ commit }) { diff --git a/zoos/bindings_zoo b/zoos/bindings_zoo index c1e4e210..0b234253 160000 --- a/zoos/bindings_zoo +++ b/zoos/bindings_zoo @@ -1 +1 @@ -Subproject commit c1e4e210883cd2601825edb36e830e505f557752 +Subproject commit 0b234253ce3a696070f9f501d40d529a1b5cb77b diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index a4545988..b021c1f4 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit a45459880d616b6d263c0c42cae0be75467be6f8 +Subproject commit b021c1f465851666aed59a042d1c6b4b38b1aaf1