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

This commit is contained in:
김진현 2024-10-04 15:53:34 +09:00
parent dae4ca4bf1
commit be691ce04b

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)
# 파일 응답 반환