JacobLinCool commited on
Commit
f62ad4c
1 Parent(s): 923d72f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -7,8 +7,6 @@ from joblib import memory
7
 
8
  memory = memory.Memory(location="cache", verbose=0)
9
 
10
- rvc = RVC.from_pretrained(MODEL_NAME)
11
-
12
  @memory.cache(ignore=["client"])
13
  def split(client, audio):
14
  result = client.predict(
@@ -18,7 +16,8 @@ def split(client, audio):
18
  )
19
  return result[0], result[1]
20
 
21
- def process_audio(client, audio, pitch_modification):
 
22
  vocal, bgm = split(client, audio)
23
  samples = rvc.convert(vocal, pitch_modification=pitch_modification)
24
 
@@ -50,7 +49,7 @@ with gr.Blocks() as demo:
50
 
51
  btn.submit(
52
  process_audio,
53
- [client, gr.Audio(type="filepath"), gr.Slider(minimum=-36, maximum=36, value=0, step=1)],
54
  [gr.Audio(label="Combined"), gr.Audio(label="Vocal"), gr.Audio(label="Background")]
55
  )
56
 
 
7
 
8
  memory = memory.Memory(location="cache", verbose=0)
9
 
 
 
10
  @memory.cache(ignore=["client"])
11
  def split(client, audio):
12
  result = client.predict(
 
16
  )
17
  return result[0], result[1]
18
 
19
+ def process_audio(client, model, audio, pitch_modification):
20
+ rvc = RVC.from_pretrained(model)
21
  vocal, bgm = split(client, audio)
22
  samples = rvc.convert(vocal, pitch_modification=pitch_modification)
23
 
 
49
 
50
  btn.submit(
51
  process_audio,
52
+ [client, gr.Text("someone/model"), gr.Audio(type="filepath"), gr.Slider(minimum=-36, maximum=36, value=0, step=1)],
53
  [gr.Audio(label="Combined"), gr.Audio(label="Vocal"), gr.Audio(label="Background")]
54
  )
55