This commit is contained in:
Shamil 2026-03-24 23:41:26 +03:00 committed by GitHub
parent c24a4da17d
commit e4de5c5ad1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,18 +2,17 @@ import base64
import os
import random
from pathlib import Path
from typing import Annotated
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):
def version_callback(value: bool) -> None:
if value:
from open_webui.env import VERSION
@ -23,7 +22,7 @@ def version_callback(value: bool):
@app.command()
def main(
version: Annotated[Optional[bool], typer.Option('--version', callback=version_callback)] = None,
version: Annotated[bool | None, typer.Option('--version', callback=version_callback)] = None,
):
pass
@ -66,7 +65,7 @@ def serve(
os.environ['USE_CUDA_DOCKER'] = 'false'
os.environ['LD_LIBRARY_PATH'] = ':'.join(LD_LIBRARY_PATH)
import open_webui.main # we need set environment variables before importing main
import open_webui.main # noqa: F401
from open_webui.env import UVICORN_WORKERS # Import the workers setting
uvicorn.run(