Spaces:
Build error
Build error
juancopi81
commited on
Commit
•
80f9ee2
1
Parent(s):
eb3a234
Rollback to MT3 and adding gradio box
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ os.putenv("QT_QPA_PLATFORM", "offscreen")
|
|
25 |
os.putenv("XDG_RUNTIME_DIR", environment.Environment().getRootTempDir())
|
26 |
|
27 |
# Start inference model
|
28 |
-
inference_model = InferenceModel("/home/user/app/checkpoints/
|
29 |
current_model = "ismir2021"
|
30 |
|
31 |
def change_model(model):
|
@@ -93,35 +93,38 @@ with demo:
|
|
93 |
+ "</h1>")
|
94 |
gr.Markdown(description)
|
95 |
with gr.Box():
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
|
126 |
with gr.Row():
|
127 |
midi_file = gr.File()
|
|
|
25 |
os.putenv("XDG_RUNTIME_DIR", environment.Environment().getRootTempDir())
|
26 |
|
27 |
# Start inference model
|
28 |
+
inference_model = InferenceModel("/home/user/app/checkpoints/mt3/", "mt3")
|
29 |
current_model = "ismir2021"
|
30 |
|
31 |
def change_model(model):
|
|
|
93 |
+ "</h1>")
|
94 |
gr.Markdown(description)
|
95 |
with gr.Box():
|
96 |
+
with gr.Box():
|
97 |
+
model_label = """
|
98 |
+
What kind of model you want to use?
|
99 |
+
The ismir2021 model transcribes piano only, with note velocities.
|
100 |
+
The mt3 model transcribes multiple simultaneous instruments, but without velocities.
|
101 |
+
"""
|
102 |
+
model = gr.Radio(
|
103 |
+
["mt3", "ismir2021"],
|
104 |
+
label=model_label,
|
105 |
+
value="mt3"
|
106 |
+
)
|
107 |
+
model.change(fn=change_model, inputs=model, outputs=[])
|
108 |
+
|
109 |
+
with gr.Row():
|
110 |
+
link = gr.Textbox(label="YouTube Link")
|
111 |
+
with gr.Row():
|
112 |
+
preview_btn = gr.Button("Preview")
|
113 |
+
|
114 |
+
with gr.Box():
|
115 |
+
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
116 |
+
title = gr.Label(label="Video Title", placeholder="Title")
|
117 |
+
img = gr.Image(label="Thumbnail")
|
118 |
+
with gr.Row():
|
119 |
+
yt_audio = gr.Audio()
|
120 |
+
yt_audio_path = gr.Textbox(visible=False)
|
121 |
+
|
122 |
+
preview_btn.click(fn=populate_metadata,
|
123 |
+
inputs=[link],
|
124 |
+
outputs=[img, title, yt_audio, yt_audio_path])
|
125 |
+
|
126 |
+
with gr.Row():
|
127 |
+
btn = gr.Button("Transcribe music")
|
128 |
|
129 |
with gr.Row():
|
130 |
midi_file = gr.File()
|