Daryl Fung commited on
Commit
bcc60c1
1 Parent(s): 3388c54

added file explorer

Browse files
Files changed (1) hide show
  1. infer-web.py +13 -0
infer-web.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
  import sys
3
  from dotenv import load_dotenv
 
4
 
5
  now_dir = os.getcwd()
6
  sys.path.append(now_dir)
@@ -1595,6 +1596,18 @@ with gr.Blocks(title="RVC WebUI") as app:
1595
  export_onnx, [ckpt_dir, onnx_dir], infoOnnx, api_name="export_onnx"
1596
  )
1597
 
 
 
 
 
 
 
 
 
 
 
 
 
1598
  tab_faq = i18n("常见问题解答")
1599
  with gr.TabItem(tab_faq):
1600
  try:
 
1
  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)
 
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
1605
+ return gr.DownloadButton(label=f"Download {name}", value=name, visible=True)
1606
+ file = gr.FileExplorer(file_count='single')
1607
+ download_button = gr.DownloadButton(label=f"Download", visible=False)
1608
+ file.change(file_changing, file, download_button)
1609
+
1610
+
1611
  tab_faq = i18n("常见问题解答")
1612
  with gr.TabItem(tab_faq):
1613
  try: