mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-12 16:23:26 +00:00
24 lines
672 B
Python
24 lines
672 B
Python
import uvicorn
|
|
import logging
|
|
from injector import Injector,inject
|
|
from src.configuration import LogConf, singleton
|
|
|
|
import argparse
|
|
|
|
|
|
@singleton
|
|
class Main():
|
|
|
|
@inject
|
|
def __init__(self, logConf: LogConf) -> None:
|
|
logging.basicConfig(level=logConf.level,filename=logConf.filename,format="%(asctime)s %(levelname)s %(message)s")
|
|
|
|
def run(self):
|
|
logger = logging.getLogger(__name__)
|
|
logger.info("jarvis-models start", extra={"version": "0.0.1"})
|
|
uvicorn.run("server:app", host="0.0.0.0", port=8000, log_level="info",reload = True)
|
|
|
|
if __name__ == "__main__":
|
|
injector = Injector()
|
|
main = injector.get(Main)
|
|
main.run() |