SefyanKehail commited on
Commit
2317b1b
·
1 Parent(s): 9c481c3

using model.pth and index.pth by default

Browse files
Files changed (3) hide show
  1. app.py +16 -22
  2. example2/test2.wav +0 -0
  3. test.wav +0 -0
app.py CHANGED
@@ -9,6 +9,10 @@ import soundfile as sf
9
  from infer_rvc_python.main import download_manager
10
  import zipfile
11
 
 
 
 
 
12
  logging.getLogger("infer_rvc_python").setLevel(logging.ERROR)
13
 
14
  converter = BaseLoader(only_cpu=False, hubert_path=None, rmvpe_path=None)
@@ -120,6 +124,10 @@ def run(
120
  if isinstance(audio_files, str):
121
  audio_files = [audio_files]
122
 
 
 
 
 
123
  if file_m is not None and file_m.endswith(".txt"):
124
  file_m, file_index = find_my_model(file_m, file_index)
125
  print(file_m, file_index)
@@ -144,9 +152,9 @@ def run(
144
 
145
 
146
  def audio_conf():
147
- return gr.File(
148
- label="Audio files",
149
- file_count="multiple",
150
  type="filepath",
151
  container=True,
152
  )
@@ -238,9 +246,9 @@ def button_conf():
238
 
239
 
240
  def output_conf():
241
- return gr.File(
 
242
  label="Result",
243
- file_count="multiple",
244
  interactive=False,
245
  )
246
 
@@ -251,10 +259,6 @@ def get_gui(theme):
251
  gr.Markdown(description)
252
 
253
  aud = audio_conf()
254
- with gr.Column():
255
- with gr.Row():
256
- model = model_conf()
257
- indx = index_conf()
258
  algo = pitch_algo_conf()
259
  algo_lvl = pitch_lvl_conf()
260
  indx_inf = index_inf_conf()
@@ -268,10 +272,8 @@ def get_gui(theme):
268
  run,
269
  inputs=[
270
  aud,
271
- model,
272
  algo,
273
  algo_lvl,
274
- indx,
275
  indx_inf,
276
  res_fc,
277
  envel_r,
@@ -284,33 +286,27 @@ def get_gui(theme):
284
  gr.Examples(
285
  examples=[
286
  [
287
- ["./test.ogg"],
288
- "./model.pth",
289
  "rmvpe+",
290
  0,
291
- "./model.index",
292
  0.75,
293
  3,
294
  0.25,
295
  0.50,
296
  ],
297
  [
298
- ["./example2/test2.ogg"],
299
- "./example2/model_link.txt",
300
  "rmvpe+",
301
  0,
302
- "./example2/index_link.txt",
303
  0.75,
304
  3,
305
  0.25,
306
  0.50,
307
  ],
308
  [
309
- ["./example3/test3.wav"],
310
- "./example3/zip_link.txt",
311
  "rmvpe+",
312
  0,
313
- None,
314
  0.75,
315
  3,
316
  0.25,
@@ -321,10 +317,8 @@ def get_gui(theme):
321
  fn=run,
322
  inputs=[
323
  aud,
324
- model,
325
  algo,
326
  algo_lvl,
327
- indx,
328
  indx_inf,
329
  res_fc,
330
  envel_r,
 
9
  from infer_rvc_python.main import download_manager
10
  import zipfile
11
 
12
+ default_model_path = "model.pth"
13
+ default_index_path = "model.index"
14
+
15
+
16
  logging.getLogger("infer_rvc_python").setLevel(logging.ERROR)
17
 
18
  converter = BaseLoader(only_cpu=False, hubert_path=None, rmvpe_path=None)
 
124
  if isinstance(audio_files, str):
125
  audio_files = [audio_files]
126
 
127
+ if file_m is None:
128
+ file_m = default_model_path
129
+ file_index = default_index_path
130
+
131
  if file_m is not None and file_m.endswith(".txt"):
132
  file_m, file_index = find_my_model(file_m, file_index)
133
  print(file_m, file_index)
 
152
 
153
 
154
  def audio_conf():
155
+ return gr.Audio(
156
+ sources=["upload", "microphone"],
157
+ label="Audio file",
158
  type="filepath",
159
  container=True,
160
  )
 
246
 
247
 
248
  def output_conf():
249
+ return gr.Audio(
250
+ type="numpy",
251
  label="Result",
 
252
  interactive=False,
253
  )
254
 
 
259
  gr.Markdown(description)
260
 
261
  aud = audio_conf()
 
 
 
 
262
  algo = pitch_algo_conf()
263
  algo_lvl = pitch_lvl_conf()
264
  indx_inf = index_inf_conf()
 
272
  run,
273
  inputs=[
274
  aud,
 
275
  algo,
276
  algo_lvl,
 
277
  indx_inf,
278
  res_fc,
279
  envel_r,
 
286
  gr.Examples(
287
  examples=[
288
  [
289
+ "./test.ogg",
 
290
  "rmvpe+",
291
  0,
 
292
  0.75,
293
  3,
294
  0.25,
295
  0.50,
296
  ],
297
  [
298
+ "./example2/test2.ogg",
 
299
  "rmvpe+",
300
  0,
 
301
  0.75,
302
  3,
303
  0.25,
304
  0.50,
305
  ],
306
  [
307
+ "./example3/test3.wav",
 
308
  "rmvpe+",
309
  0,
 
310
  0.75,
311
  3,
312
  0.25,
 
317
  fn=run,
318
  inputs=[
319
  aud,
 
320
  algo,
321
  algo_lvl,
 
322
  indx_inf,
323
  res_fc,
324
  envel_r,
example2/test2.wav ADDED
Binary file (118 kB). View file
 
test.wav ADDED
Binary file (588 kB). View file