Spaces:
Runtime error
Runtime error
Daryl Fung
commited on
Commit
•
a851e04
1
Parent(s):
e98e9b5
updated app.py
Browse files
app.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)
|
@@ -130,10 +131,10 @@ else:
|
|
130 |
gpus = "-".join([i[0] for i in gpu_infos])
|
131 |
|
132 |
|
133 |
-
weight_root = 'assets/weights'
|
134 |
-
weight_uvr5_root = 'assets/uvr5_weights'
|
135 |
-
index_root = 'assets/indices'
|
136 |
-
outside_index_root = 'assets'
|
137 |
|
138 |
names = []
|
139 |
for name in os.listdir(weight_root):
|
@@ -1595,6 +1596,17 @@ 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)
|
|
|
131 |
gpus = "-".join([i[0] for i in gpu_infos])
|
132 |
|
133 |
|
134 |
+
weight_root = './assets/weights'
|
135 |
+
weight_uvr5_root = './assets/uvr5_weights'
|
136 |
+
index_root = './assets/indices'
|
137 |
+
outside_index_root = './assets'
|
138 |
|
139 |
names = []
|
140 |
for name in os.listdir(weight_root):
|
|
|
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 |
tab_faq = i18n("常见问题解答")
|
1611 |
with gr.TabItem(tab_faq):
|
1612 |
try:
|