diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index de34a8bc7..d85be48da 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -5,12 +5,31 @@ from pathlib import Path import typer import uvicorn +from typing import Optional +from typing_extensions import Annotated app = typer.Typer() KEY_FILE = Path.cwd() / ".webui_secret_key" +def version_callback(value: bool): + if value: + from open_webui.env import VERSION + + typer.echo(f"Open WebUI version: {VERSION}") + raise typer.Exit() + + +@app.command() +def main( + version: Annotated[ + Optional[bool], typer.Option("--version", callback=version_callback) + ] = None, +): + pass + + @app.command() def serve( host: str = "0.0.0.0", diff --git a/backend/requirements.txt b/backend/requirements.txt index 9e349bfb2..fcd53ea74 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -47,6 +47,8 @@ pymilvus==2.5.0 qdrant-client~=1.12.0 opensearch-py==2.7.1 + +transformers sentence-transformers==3.3.1 colbert-ai==0.2.21 einops==0.8.0 diff --git a/pyproject.toml b/pyproject.toml index 29980d3a7..50cd84121 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ dependencies = [ "qdrant-client~=1.12.0", "opensearch-py==2.7.1", + "transformers", "sentence-transformers==3.3.1", "colbert-ai==0.2.21", "einops==0.8.0",