Spaces:
Sleeping
Sleeping
modify app
Browse files
app.py
CHANGED
@@ -128,7 +128,7 @@ with gr.Blocks() as demo:
|
|
128 |
|
129 |
with gr.Row():
|
130 |
output_audio = gr.Audio(label="Output Audio", type='numpy')
|
131 |
-
param_output = gr.Textbox(label="Predicted Parameters", lines=
|
132 |
|
133 |
process_button.click(
|
134 |
process_audio,
|
@@ -139,21 +139,39 @@ with gr.Blocks() as demo:
|
|
139 |
gr.Markdown("## Inference Time Optimization (ITO)")
|
140 |
|
141 |
with gr.Row():
|
142 |
-
|
143 |
-
|
144 |
-
num_steps = gr.Slider(minimum=1, maximum=
|
145 |
optimizer = gr.Dropdown(["Adam", "RAdam", "SGD"], value="RAdam", label="Optimizer")
|
146 |
learning_rate = gr.Slider(minimum=0.0001, maximum=0.1, value=0.001, step=0.0001, label="Learning Rate")
|
147 |
af_weights = gr.Textbox(label="AudioFeatureLoss Weights (comma-separated)", value="0.1,0.001,1.0,1.0,0.1")
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
151 |
ito_output_audio = gr.Audio(label="ITO Output Audio")
|
152 |
-
ito_param_output = gr.Textbox(label="ITO Predicted Parameters", lines=
|
|
|
153 |
ito_steps_taken = gr.Number(label="ITO Steps Taken")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
|
158 |
def run_ito(input_audio, reference_audio, ito_reference_audio, num_steps, optimizer, learning_rate, af_weights):
|
159 |
af_weights = [float(w.strip()) for w in af_weights.split(',')]
|
|
|
128 |
|
129 |
with gr.Row():
|
130 |
output_audio = gr.Audio(label="Output Audio", type='numpy')
|
131 |
+
param_output = gr.Textbox(label="Predicted Parameters", lines=5)
|
132 |
|
133 |
process_button.click(
|
134 |
process_audio,
|
|
|
139 |
gr.Markdown("## Inference Time Optimization (ITO)")
|
140 |
|
141 |
with gr.Row():
|
142 |
+
ito_reference_audio = gr.Audio(label="ITO Reference Audio (optional)")
|
143 |
+
with gr.Column():
|
144 |
+
num_steps = gr.Slider(minimum=1, maximum=100, value=10, step=1, label="Number of Steps")
|
145 |
optimizer = gr.Dropdown(["Adam", "RAdam", "SGD"], value="RAdam", label="Optimizer")
|
146 |
learning_rate = gr.Slider(minimum=0.0001, maximum=0.1, value=0.001, step=0.0001, label="Learning Rate")
|
147 |
af_weights = gr.Textbox(label="AudioFeatureLoss Weights (comma-separated)", value="0.1,0.001,1.0,1.0,0.1")
|
148 |
+
|
149 |
+
ito_button = gr.Button("Perform ITO")
|
150 |
+
|
151 |
+
with gr.Row():
|
152 |
+
with gr.Column():
|
153 |
ito_output_audio = gr.Audio(label="ITO Output Audio")
|
154 |
+
ito_param_output = gr.Textbox(label="ITO Predicted Parameters", lines=5)
|
155 |
+
with gr.Column():
|
156 |
ito_steps_taken = gr.Number(label="ITO Steps Taken")
|
157 |
+
ito_log = gr.Textbox(label="ITO Log", lines=10)
|
158 |
+
|
159 |
+
# with gr.Row():
|
160 |
+
# with gr.Column(scale=2):
|
161 |
+
# ito_reference_audio = gr.Audio(label="ITO Reference Audio (optional)")
|
162 |
+
# num_steps = gr.Slider(minimum=1, maximum=100, value=10, step=1, label="Number of Steps")
|
163 |
+
# optimizer = gr.Dropdown(["Adam", "RAdam", "SGD"], value="RAdam", label="Optimizer")
|
164 |
+
# learning_rate = gr.Slider(minimum=0.0001, maximum=0.1, value=0.001, step=0.0001, label="Learning Rate")
|
165 |
+
# af_weights = gr.Textbox(label="AudioFeatureLoss Weights (comma-separated)", value="0.1,0.001,1.0,1.0,0.1")
|
166 |
+
|
167 |
+
# ito_button = gr.Button("Perform ITO")
|
168 |
+
|
169 |
+
# ito_output_audio = gr.Audio(label="ITO Output Audio")
|
170 |
+
# ito_param_output = gr.Textbox(label="ITO Predicted Parameters", lines=10)
|
171 |
+
# ito_steps_taken = gr.Number(label="ITO Steps Taken")
|
172 |
|
173 |
+
# with gr.Column(scale=1):
|
174 |
+
# ito_log = gr.Textbox(label="ITO Log", lines=30)
|
175 |
|
176 |
def run_ito(input_audio, reference_audio, ito_reference_audio, num_steps, optimizer, learning_rate, af_weights):
|
177 |
af_weights = [float(w.strip()) for w in af_weights.split(',')]
|