Initial commit
This commit is contained in:
17
routers/evaluate.py
Normal file
17
routers/evaluate.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from loguru import logger
|
||||
|
||||
import config
|
||||
from train.trainer import run_evaluate, _get_latest_model_path
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("", summary="모델 평가")
|
||||
def evaluate(test_size: float = 0.2):
|
||||
if not _get_latest_model_path():
|
||||
raise HTTPException(
|
||||
status_code=400, detail="저장된 모델 없음. 학습 먼저 실행하세요."
|
||||
)
|
||||
logger.info(f"평가 요청 | test_size={test_size}")
|
||||
return run_evaluate(test_size)
|
||||
Reference in New Issue
Block a user