move cli and api into wrapper

This commit is contained in:
Ftps
2024-03-07 21:50:15 +09:00
parent 0c3c512396
commit 785abd7830
12 changed files with 75 additions and 19 deletions
+18
View File
@@ -0,0 +1,18 @@
from fastapi import APIRouter, Response, UploadFile, responses
from rvc.modules.uvr5.modules import UVR
router = APIRouter()
@router.post("/inference")
def uvr(inputpath, outputpath, modelname, format):
uvr_module = UVR()
uvr_module.uvr_wrapper(
inputpath, outputpath, model_name=modelname, export_format=format
)
return responses.StreamingResponse(
audio,
media_type="audio/wav",
headers={"Content-Disposition": "attachment; filename=inference.wav"},
)