Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ def load_text_file(file_path):
|
|
| 51 |
return str(e)
|
| 52 |
|
| 53 |
# Define Gradio inputs and outputs for UltraSinger
|
| 54 |
-
opt_i = gr.File(label="Ultrastar.txt or audio file (.mp3, .wav,
|
| 55 |
opt_o = gr.Textbox(label="Output folder")
|
| 56 |
mode = gr.Dropdown(
|
| 57 |
label="Mode options",
|
|
@@ -87,24 +87,13 @@ ultrasinger_tab = gr.Interface(
|
|
| 87 |
fn=run_ultrasinger,
|
| 88 |
inputs=[opt_i, opt_o, mode, whisper_model, language, crepe_model, extra, device],
|
| 89 |
outputs=[output_text, error_text],
|
| 90 |
-
title="UltraSinger
|
| 91 |
description="Upload an Ultrastar.txt or an audio file, set the options, and run UltraSinger."
|
| 92 |
)
|
| 93 |
|
| 94 |
-
#
|
| 95 |
-
tab1_content =
|
| 96 |
-
|
| 97 |
-
inputs=[],
|
| 98 |
-
outputs=gr.Textbox(label="Tab 1 Content"),
|
| 99 |
-
title="Info"
|
| 100 |
-
)
|
| 101 |
-
|
| 102 |
-
tab2_content = gr.Interface(
|
| 103 |
-
fn=lambda: load_text_file("usdb.txt"),
|
| 104 |
-
inputs=[],
|
| 105 |
-
outputs=gr.Textbox(label="Tab 2 Content"),
|
| 106 |
-
title="FOR USDB USERS"
|
| 107 |
-
)
|
| 108 |
|
| 109 |
# Create Gradio tabs
|
| 110 |
with gr.Blocks(theme="soft") as demo:
|
|
@@ -112,9 +101,9 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 112 |
with gr.TabItem("UltraSinger"):
|
| 113 |
ultrasinger_tab.render()
|
| 114 |
with gr.TabItem("Info"):
|
| 115 |
-
|
| 116 |
with gr.TabItem("FOR USDB USERS"):
|
| 117 |
-
|
| 118 |
|
| 119 |
# Launch the app
|
| 120 |
if __name__ == "__main__":
|
|
|
|
| 51 |
return str(e)
|
| 52 |
|
| 53 |
# Define Gradio inputs and outputs for UltraSinger
|
| 54 |
+
opt_i = gr.File(label="Ultrastar.txt or audio file (.mp3, .wav, .txt)")
|
| 55 |
opt_o = gr.Textbox(label="Output folder")
|
| 56 |
mode = gr.Dropdown(
|
| 57 |
label="Mode options",
|
|
|
|
| 87 |
fn=run_ultrasinger,
|
| 88 |
inputs=[opt_i, opt_o, mode, whisper_model, language, crepe_model, extra, device],
|
| 89 |
outputs=[output_text, error_text],
|
| 90 |
+
title="UltraSinger UI",
|
| 91 |
description="Upload an Ultrastar.txt or an audio file, set the options, and run UltraSinger."
|
| 92 |
)
|
| 93 |
|
| 94 |
+
# Load content for Tab 1 and Tab 2
|
| 95 |
+
tab1_content = load_text_file("info.txt")
|
| 96 |
+
tab2_content = load_text_file("usdb.txt")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
# Create Gradio tabs
|
| 99 |
with gr.Blocks(theme="soft") as demo:
|
|
|
|
| 101 |
with gr.TabItem("UltraSinger"):
|
| 102 |
ultrasinger_tab.render()
|
| 103 |
with gr.TabItem("Info"):
|
| 104 |
+
gr.Markdown(tab1_content)
|
| 105 |
with gr.TabItem("FOR USDB USERS"):
|
| 106 |
+
gr.Markdown(tab2_content)
|
| 107 |
|
| 108 |
# Launch the app
|
| 109 |
if __name__ == "__main__":
|