Merge branch 'ai/fix/model' into 'ai/develop'

Fix: 모델 다운로드 path 오류 수정

See merge request s11-s-project/S11P21S002!292
This commit is contained in:
김용수 2024-10-04 15:56:13 +09:00
commit b1c6282f52

View File

@ -37,7 +37,7 @@ def create_model(project_id: int, request: ModelCreateRequest):
@router.delete("/projects/{project_id}/models/{model_key}", status_code=204)
def delete_model(project_id:int, model_key:str):
model_path = join_path("resources", "projects", project_id, "models", model_key)
model_path = join_path("resources", "projects", str(project_id), "models", model_key)
try:
delete_file(model_path)
except FileNotFoundError:
@ -71,7 +71,7 @@ def upload_model(project_id:int, file: UploadFile = File(...)):
@router.get("/download/projects/{project_id}/models/{model_key}")
def download_model(project_id:int, model_key:str):
model_path = join_path("resources", "projects", project_id, "models", model_key)
model_path = join_path("resources", "projects", str(project_id), "models", model_key)
try:
filename = get_file_name(model_path)
# 파일 응답 반환