voice-changer/demo/mods/Trainer_Model.py

14 lines
382 B
Python
Raw Normal View History

2022-11-08 13:00:47 +03:00
from fastapi.responses import FileResponse
import os
def mod_get_model(modelFile:str):
modelPath = os.path.join("/MMVC_Trainer/logs", modelFile)
return FileResponse(path=modelPath)
def mod_delete_model(modelFile:str):
modelPath = os.path.join("/MMVC_Trainer/logs", modelFile)
os.unlink(modelPath)
return {"Model deleted": f"{modelFile}"}