Daryl Fung commited on
Commit
f796b4b
1 Parent(s): a851e04

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import sys
3
  from dotenv import load_dotenv
4
  from pathlib import Path
 
5
 
6
  now_dir = os.getcwd()
7
  sys.path.append(now_dir)
@@ -1213,7 +1214,8 @@ with gr.Blocks(title="RVC WebUI") as app:
1213
  with gr.Row():
1214
  trainset_dir4 = gr.Textbox(
1215
  label=i18n("输入训练文件夹路径"),
1216
- value=i18n("E:\\语音音频+标注\\米津玄师\\src"),
 
1217
  )
1218
  spk_id5 = gr.Slider(
1219
  minimum=0,
@@ -1596,9 +1598,19 @@ with gr.Blocks(title="RVC WebUI") as app:
1596
  export_onnx, [ckpt_dir, onnx_dir], infoOnnx, api_name="export_onnx"
1597
  )
1598
 
1599
- with gr.TabItem("File Explorer"):
 
 
 
 
 
 
 
 
 
 
1600
  gr.Markdown('### `FileExplorer` to `FileExplorer` -- `file_count="single"`')
1601
- submit_btn = gr.Button("Select")
1602
  with gr.Row():
1603
  def file_changing(x):
1604
  name = Path(x).name
 
2
  import sys
3
  from dotenv import load_dotenv
4
  from pathlib import Path
5
+ import shutil
6
 
7
  now_dir = os.getcwd()
8
  sys.path.append(now_dir)
 
1214
  with gr.Row():
1215
  trainset_dir4 = gr.Textbox(
1216
  label=i18n("输入训练文件夹路径"),
1217
+ value='audios'
1218
+ # value=i18n("E:\\语音音频+标注\\米津玄师\\src"),
1219
  )
1220
  spk_id5 = gr.Slider(
1221
  minimum=0,
 
1598
  export_onnx, [ckpt_dir, onnx_dir], infoOnnx, api_name="export_onnx"
1599
  )
1600
 
1601
+ with gr.TabItem("File Explorer (upload)"):
1602
+ gr.Markdown('### `FileExplorer` to `FileExplorer` -- `file_count="single"`')
1603
+ upload_submit_btn = gr.Button("Select")
1604
+ with gr.Row():
1605
+ def upload_file(filepath):
1606
+ filename = os.path.basename(filepath)
1607
+ shutil.copy(name, os.path.join('audios', filename))
1608
+ upload_button = gr.UploadButton(label=f"Upload", visible=False)
1609
+ upload_button.upload(upload_file, upload_button, None)
1610
+
1611
+ with gr.TabItem("File Explorer (download)"):
1612
  gr.Markdown('### `FileExplorer` to `FileExplorer` -- `file_count="single"`')
1613
+ download_submit_btn = gr.Button("Select")
1614
  with gr.Row():
1615
  def file_changing(x):
1616
  name = Path(x).name