jhtonyKoo commited on
Commit
9fc25b1
1 Parent(s): 043c2d7

modify app

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. inference.py +2 -6
app.py CHANGED
@@ -95,7 +95,7 @@ def perform_ito(input_audio, reference_audio, ito_reference_audio, num_steps, op
95
  ):
96
  ito_log += log_entry
97
  ito_param_output = mastering_transfer.get_param_output_string(current_params)
98
- loss_values.append({"step": step, "loss": loss})
99
 
100
  # Convert current_output to numpy array if it's a tensor
101
  if isinstance(current_output, torch.Tensor):
@@ -155,8 +155,6 @@ with gr.Blocks() as demo:
155
  ito_output_audio = gr.Audio(label="ITO Output Audio")
156
  ito_param_output = gr.Textbox(label="ITO Predicted Parameters", lines=15)
157
  with gr.Column():
158
- ito_steps_taken = gr.Number(label="ITO Steps Taken")
159
- ito_log = gr.Textbox(label="ITO Log", lines=10)
160
  ito_loss_plot = gr.LinePlot(
161
  x="step",
162
  y="loss",
@@ -166,6 +164,7 @@ with gr.Blocks() as demo:
166
  height=400,
167
  width=600,
168
  )
 
169
 
170
  def run_ito(input_audio, reference_audio, ito_reference_audio, num_steps, optimizer, learning_rate, af_weights):
171
  af_weights = [float(w.strip()) for w in af_weights.split(',')]
 
95
  ):
96
  ito_log += log_entry
97
  ito_param_output = mastering_transfer.get_param_output_string(current_params)
98
+ loss_values.append({"step": int(step), "loss": loss})
99
 
100
  # Convert current_output to numpy array if it's a tensor
101
  if isinstance(current_output, torch.Tensor):
 
155
  ito_output_audio = gr.Audio(label="ITO Output Audio")
156
  ito_param_output = gr.Textbox(label="ITO Predicted Parameters", lines=15)
157
  with gr.Column():
 
 
158
  ito_loss_plot = gr.LinePlot(
159
  x="step",
160
  y="loss",
 
164
  height=400,
165
  width=600,
166
  )
167
+ ito_log = gr.Textbox(label="ITO Log", lines=10)
168
 
169
  def run_ito(input_audio, reference_audio, ito_reference_audio, num_steps, optimizer, learning_rate, af_weights):
170
  af_weights = [float(w.strip()) for w in af_weights.split(',')]
inference.py CHANGED
@@ -273,13 +273,9 @@ class MasteringStyleTransfer:
273
 
274
  top_diffs = sorted(all_diffs, key=lambda x: x[4], reverse=True)[:top_n]
275
 
276
- output = ["Top 10 parameter differences (sorted by normalized difference):"]
277
  for fx_name, param_name, initial_value, ito_value, normalized_diff in top_diffs:
278
- output.append(f"{fx_name.upper()} - {param_name}:")
279
- output.append(f" Initial: {initial_value:.4f}")
280
- output.append(f" ITO: {ito_value:.4f}")
281
- output.append(f" Normalized Diff: {normalized_diff:.4f}")
282
- output.append("")
283
 
284
  return "\n".join(output)
285
 
 
273
 
274
  top_diffs = sorted(all_diffs, key=lambda x: x[4], reverse=True)[:top_n]
275
 
276
+ output = [f"Top {top_n} parameter differences (initial / ITO / normalized diff):"]
277
  for fx_name, param_name, initial_value, ito_value, normalized_diff in top_diffs:
278
+ output.append(f"{fx_name.upper()} - {param_name}: {initial_value:.3f} / {ito_value:.3f} / {normalized_diff:.3f}")
 
 
 
 
279
 
280
  return "\n".join(output)
281