Skip to content

Commit e4de5c5

Browse files
authored
1 parent c24a4da commit e4de5c5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

backend/open_webui/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
import os
33
import random
44
from pathlib import Path
5+
from typing import Annotated
56

67
import typer
78
import uvicorn
8-
from typing import Optional
9-
from typing_extensions import Annotated
109

1110
app = typer.Typer()
1211

1312
KEY_FILE = Path.cwd() / '.webui_secret_key'
1413

1514

16-
def version_callback(value: bool):
15+
def version_callback(value: bool) -> None:
1716
if value:
1817
from open_webui.env import VERSION
1918

@@ -23,7 +22,7 @@ def version_callback(value: bool):
2322

2423
@app.command()
2524
def main(
26-
version: Annotated[Optional[bool], typer.Option('--version', callback=version_callback)] = None,
25+
version: Annotated[bool | None, typer.Option('--version', callback=version_callback)] = None,
2726
):
2827
pass
2928

@@ -66,7 +65,7 @@ def serve(
6665
os.environ['USE_CUDA_DOCKER'] = 'false'
6766
os.environ['LD_LIBRARY_PATH'] = ':'.join(LD_LIBRARY_PATH)
6867

69-
import open_webui.main # we need set environment variables before importing main
68+
import open_webui.main # noqa: F401
7069
from open_webui.env import UVICORN_WORKERS # Import the workers setting
7170

7271
uvicorn.run(

0 commit comments

Comments
 (0)