From a3cacb02e92319d21902d487ffb459ec48f33afb Mon Sep 17 00:00:00 2001 From: arkohut <39525455+arkohut@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:13:46 +0800 Subject: [PATCH] feat: always enable vlm and ocr plugin --- memos/config.py | 2 -- memos/default_config.yaml | 2 -- memos/server.py | 14 ++++++-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/memos/config.py b/memos/config.py index 6940a8e..7e53faf 100644 --- a/memos/config.py +++ b/memos/config.py @@ -16,7 +16,6 @@ import typer class VLMSettings(BaseModel): - enabled: bool = True modelname: str = "minicpm-v" endpoint: str = "http://localhost:11434" token: str = "" @@ -28,7 +27,6 @@ class VLMSettings(BaseModel): class OCRSettings(BaseModel): - enabled: bool = True # will by ignored if use_local is True endpoint: str = "http://localhost:5555/predict" token: str = "" diff --git a/memos/default_config.yaml b/memos/default_config.yaml index 5ff924e..0915ce3 100644 --- a/memos/default_config.yaml +++ b/memos/default_config.yaml @@ -16,7 +16,6 @@ default_plugins: # using ollama as the vlm server vlm: concurrency: 1 - enabled: true endpoint: http://localhost:11434 force_jpeg: true modelname: minicpm-v @@ -26,7 +25,6 @@ vlm: # using local ocr ocr: concurrency: 1 - enabled: true # this is not used if use_local is true endpoint: http://localhost:5555/predict force_jpeg: false diff --git a/memos/server.py b/memos/server.py index 2ebf4e2..e1aa80c 100644 --- a/memos/server.py +++ b/memos/server.py @@ -878,16 +878,14 @@ def run_server(): print(f"OCR plugin enabled: {settings.ocr}") # Add VLM plugin router - if settings.vlm.enabled: - print("VLM plugin is enabled") - vlm_main.init_plugin(settings.vlm) - app.include_router(vlm_main.router, prefix="/plugins/vlm") + # Removed check for settings.vlm.enabled + vlm_main.init_plugin(settings.vlm) + app.include_router(vlm_main.router, prefix="/plugins/vlm") # Add OCR plugin router - if settings.ocr.enabled: - print("OCR plugin is enabled") - ocr_main.init_plugin(settings.ocr) - app.include_router(ocr_main.router, prefix="/plugins/ocr") + # Removed check for settings.ocr.enabled + ocr_main.init_plugin(settings.ocr) + app.include_router(ocr_main.router, prefix="/plugins/ocr") uvicorn.run( "memos.server:app",