arxivgpt kim commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,22 +135,20 @@ footer {
|
|
| 135 |
}
|
| 136 |
"""
|
| 137 |
|
| 138 |
-
|
| 139 |
with gr.Blocks(css=css) as demo:
|
| 140 |
with gr.Column():
|
| 141 |
-
# 'value' 매개변수를 제거함
|
| 142 |
image_in = gr.Image(sources=["upload"], type="filepath", label="Image input")
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
-
submit_btn.click(
|
| 150 |
-
fn=infer,
|
| 151 |
-
inputs=[image_in, chosen_model],
|
| 152 |
-
outputs=[audio_o]
|
| 153 |
-
)
|
| 154 |
|
| 155 |
|
| 156 |
demo.queue(max_size=10).launch(debug=True)
|
|
|
|
| 135 |
}
|
| 136 |
"""
|
| 137 |
|
|
|
|
| 138 |
with gr.Blocks(css=css) as demo:
|
| 139 |
with gr.Column():
|
|
|
|
| 140 |
image_in = gr.Image(sources=["upload"], type="filepath", label="Image input")
|
| 141 |
+
chosen_model = gr.Radio(label="Choose a model", choices=["MAGNet", "AudioLDM-2", "AudioGen"], value="AudioLDM-2")
|
| 142 |
+
submit_btn = gr.Button("Submit")
|
| 143 |
+
audio_o = gr.Audio(label="Audio output")
|
| 144 |
+
|
| 145 |
+
# 이벤트 바인딩을 gr.Blocks 컨텍스트 내부로 이동
|
| 146 |
+
submit_btn.click(
|
| 147 |
+
fn=infer,
|
| 148 |
+
inputs=[image_in, chosen_model],
|
| 149 |
+
outputs=[audio_o]
|
| 150 |
+
)
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
|
| 154 |
demo.queue(max_size=10).launch(debug=True)
|