1
1
import io
2
2
import json
3
- import os
4
3
5
4
import gradio as gr
6
5
import requests
7
6
import soundfile as sf
8
7
import torch .multiprocessing as multiprocessing
9
8
from scipy .io .wavfile import write
10
9
11
- from modules .shared import ROOT_DIR
12
10
from modules .ui import Tab
13
11
from server import app
14
12
17
15
def server_options_ui (show_out_dir = True ):
18
16
with gr .Row ().style (equal_height = False ):
19
17
with gr .Row ():
20
- host = gr .Textbox (value = "127.0.0.1" , label = "RVC model file path " )
21
- port = gr .Textbox (value = "5001" , label = "Faiss index file path " )
18
+ host = gr .Textbox (value = "127.0.0.1" , label = "host " )
19
+ port = gr .Textbox (value = "5001" , label = "port " )
22
20
with gr .Row ().style (equal_height = False ):
23
21
with gr .Row ():
24
22
rvc_model_file = gr .Textbox (value = "" , label = "RVC model file path" )
25
23
faiss_index_file = gr .Textbox (value = "" , label = "Faiss index file path" )
26
24
with gr .Row ().style (equal_height = False ):
27
25
with gr .Row ():
28
- input_voice_file = gr .Textbox (value = "" , label = "convert voice file path" )
26
+ input_voice_file = gr .Textbox (value = "" , label = "input voice file path" )
29
27
speaker_id = gr .Number (
30
28
value = 0 ,
31
29
label = "speaker_id" ,
@@ -45,8 +43,6 @@ def server_options_ui(show_out_dir=True):
45
43
step = 0.01 ,
46
44
label = "retrieval_feature_ratio" ,
47
45
)
48
-
49
-
50
46
return (
51
47
host ,
52
48
port ,
@@ -71,21 +67,10 @@ def sort(self):
71
67
72
68
def ui (self , outlet ):
73
69
def start (host , port ):
74
- global proc
75
-
76
70
if multiprocessing .get_start_method () == 'fork' :
77
71
multiprocessing .set_start_method ('spawn' , force = True )
78
- #os.environ["PATH"] = (
79
- # os.path.join(ROOT_DIR, "bin")
80
- # + os.pathsep
81
- # + os.environ.get("PATH", "")
82
- #)
83
72
proc = multiprocessing .Process (target = run , kwargs = {'host' : host , 'port' : port })
84
73
proc .start ()
85
- # デバッグ用
86
- # import subprocess
87
- # os.environ["FLASK_APP"] = os.path.join(ROOT_DIR, "server.py")
88
- # subprocess.Popen(f"flask run --host {host} --port {port}", shell=True)
89
74
yield "start server"
90
75
91
76
def upload (host , port , rvc_model_file , faiss_index_file ):
0 commit comments