voice-changer/server/restapi/mods/Trainer_Model.py

15 lines
363 B
Python
Raw Normal View History

2022-12-31 14:25:28 +03:00
from fastapi.responses import FileResponse
import os
2023-02-16 21:03:21 +03:00
def mod_get_model(modelFile: str):
modelPath = os.path.join("MMVC_Trainer/logs", modelFile)
return FileResponse(path=modelPath)
2022-12-31 14:25:28 +03:00
2023-02-16 21:03:21 +03:00
def mod_delete_model(modelFile: str):
modelPath = os.path.join("MMVC_Trainer/logs", modelFile)
os.remove(modelPath)
return {"Model deleted": f"{modelFile}"}