mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
Main: Make openapi export store locally
This runs faster than always making a syscall to check if the env var is set. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -12,8 +12,9 @@ from typing import Optional
|
||||
from common import config
|
||||
from common.logger import get_loading_progress_bar
|
||||
from common.utils import unwrap
|
||||
from endpoints.utils import do_export_openapi
|
||||
|
||||
if os.getenv("EXPORT_OPENAPI", "").lower() not in ("true", "1"):
|
||||
if not do_export_openapi:
|
||||
from backends.exllamav2.model import ExllamaV2Container
|
||||
|
||||
# Global model container
|
||||
|
||||
3
endpoints/utils.py
Normal file
3
endpoints/utils.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import os
|
||||
|
||||
do_export_openapi = os.getenv("EXPORT_OPENAPI", "").lower() in ("true", "1")
|
||||
5
main.py
5
main.py
@@ -9,7 +9,6 @@ import signal
|
||||
from loguru import logger
|
||||
from typing import Optional
|
||||
|
||||
from backends.exllamav2.utils import check_exllama_version
|
||||
from common import config, gen_logging, sampling, model
|
||||
from common.args import convert_args_to_dict, init_argparser
|
||||
from common.auth import load_auth_keys
|
||||
@@ -18,6 +17,10 @@ from common.networking import is_port_in_use
|
||||
from common.signals import signal_handler
|
||||
from common.utils import unwrap
|
||||
from endpoints.server import export_openapi, start_api
|
||||
from endpoints.utils import do_export_openapi
|
||||
|
||||
if not do_export_openapi:
|
||||
from backends.exllamav2.utils import check_exllama_version
|
||||
|
||||
|
||||
async def entrypoint(args: Optional[dict] = None):
|
||||
|
||||
Reference in New Issue
Block a user