chore: update support development_mode as DEBUG and support for RELOAD

envvar

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
Aaron Pham
2024-03-22 01:19:32 +00:00
parent 80b35f0d72
commit 3ef93fe371
3 changed files with 5 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
import os, logging, traceback, pathlib, sys, fs, click, enum, inflection, bentoml, orjson, openllm, openllm_core, platform, typing as t
from ._helpers import recommended_instance_type
from openllm_core.utils import (
DEBUG,
DEBUG_ENV_VAR,
QUIET_ENV_VAR,
SHOW_CODEGEN,
@@ -286,7 +287,7 @@ def start_command(
sys.path.insert(0, working_dir)
service = load('.', working_dir=working_dir)
service.inject_config()
serve_http('.', working_dir=working_dir)
serve_http('.', working_dir=working_dir, reload=check_bool_env('RELOAD', default=False), development_mode=DEBUG)
def construct_python_options(llm_config, llm_fs):

View File

@@ -26,7 +26,7 @@ except Exception:
llm_config = core.AutoConfig.for_model(svars.model_name)
GenerationInput = core.GenerationInput.from_config(llm_config)
app_v1 = FastAPI(debug=True, description='OpenAI Compatible API support')
app_v1 = FastAPI(description='OpenAI Compatible API support')
@bentoml.mount_asgi_app(app_v1)
@@ -160,7 +160,3 @@ class LLMService:
return ModelList(
data=[ModelCard(root=core.utils.normalise_model_name(model_id), id=core.utils.normalise_model_name(model_id))]
)
if __name__ == '__main__':
LLMService.serve_http(reload=core.utils.check_bool_env('RELOAD', False))