chore: add script

This commit is contained in:
bojiang
2024-05-27 15:44:29 +08:00
parent a17536c691
commit 5520d6b554
2 changed files with 15 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
import typer
from openllm_next.model import app as model_app
from openllm_next.repo import app as repo_app
from openllm_next.serve import serve as local_serve, run as local_run
from openllm_next.cloud import app as cloud_app
from openllm_next.common import VERBOSE_LEVEL
from openllm_next.model import app as model_app
from openllm_next.repo import app as repo_app
from openllm_next.serve import run as local_run
from openllm_next.serve import serve as local_serve
app = typer.Typer()
@@ -23,11 +24,15 @@ def run(model: str):
local_run(model)
def main_callback(verbose: int = 0):
def typer_callback(verbose: int = 0):
if verbose:
VERBOSE_LEVEL.set(verbose)
if __name__ == "__main__":
app.callback()(main_callback)
def main():
app.callback()(typer_callback)
app()
if __name__ == "__main__":
main()

View File

@@ -18,5 +18,8 @@ dependencies = [
"pip_requirements_parser",
]
[project.scripts]
openllm = "openllm_next.__main__:main"
[tool.typer]
src-dir = "openllm_next"