Singhp08 commited on
Commit
2d59b32
·
verified ·
1 Parent(s): 42f19cb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, request, send_file
2
+ from rvc_python.infer import RVCInference
3
+ import os
4
+
5
+ app = Flask(__name__)
6
+
7
+ @app.route('/convert', methods=['POST'])
8
+ def convert():
9
+ data = request.json
10
+ text = data.get('text')
11
+ model_name = data.get('model') # elvish, modi, etc.
12
+
13
+ # RVC Logic yahan chalegi
14
+ rvc = RVCInference(device="cpu")
15
+ model_path = f"./models/{model_name}.pth"
16
+ output_path = "output.wav"
17
+
18
+ # TTS + RVC Process
19
+ # (Yahan apna gTTS + rvc.infer wala logic dalo)
20
+
21
+ return send_file(output_path, mimetype="audio/wav")
22
+
23
+ if __name__ == "__main__":
24
+ app.run(host="0.0.0.0", port=7860)