Ahsen Khaliq commited on
Commit
fdd44a9
·
1 Parent(s): 9ac8728

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -175,16 +175,16 @@ model_synth = torch.load("synth2synth_full.pt", map_location="cpu").eval()
175
 
176
 
177
 
178
- def inference(aud, effect_type):
179
  x_p, sample_rate = torchaudio.load(aud)
180
 
181
  effect_type = effect_type #@param ["Compressor", "Reverb", "Amp", "Analog Delay", "Synth2Synth"]
182
- gain_dB = -24 #@param {type:"slider", min:-24, max:24, step:0.1}
183
- c0 = -1.4 #@param {type:"slider", min:-10, max:10, step:0.1}
184
- c1 = 3 #@param {type:"slider", min:-10, max:10, step:0.1}
185
- mix = 70 #@param {type:"slider", min:0, max:100, step:1}
186
- width = 50 #@param {type:"slider", min:0, max:100, step:1}
187
- max_length = 30 #@param {type:"slider", min:5, max:120, step:1}
188
  stereo = True #@param {type:"boolean"}
189
  tail = True #@param {type:"boolean"}
190
 
@@ -268,7 +268,11 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.029
268
 
269
  gr.Interface(
270
  inference,
271
- [gr.inputs.Audio(type="filepath", label="Input"),gr.inputs.Dropdown(choices=["Compressor", "Reverb", "Amp", "Analog Delay", "Synth2Synth"], type="value", default="Analog Delay", label="Effect Type")],
 
 
 
 
272
  gr.outputs.Audio(type="file", label="Output"),
273
  title=title,
274
  description=description,
 
175
 
176
 
177
 
178
+ def inference(aud, effect_type,gain_dB,c0,c1,mix,width,max_length):
179
  x_p, sample_rate = torchaudio.load(aud)
180
 
181
  effect_type = effect_type #@param ["Compressor", "Reverb", "Amp", "Analog Delay", "Synth2Synth"]
182
+ gain_dB = gain_dB #@param {type:"slider", min:-24, max:24, step:0.1}
183
+ c0 = c0 #@param {type:"slider", min:-10, max:10, step:0.1}
184
+ c1 = c1 #@param {type:"slider", min:-10, max:10, step:0.1}
185
+ mix = mix #@param {type:"slider", min:0, max:100, step:1}
186
+ width = width #@param {type:"slider", min:0, max:100, step:1}
187
+ max_length = max_length#@param {type:"slider", min:5, max:120, step:1}
188
  stereo = True #@param {type:"boolean"}
189
  tail = True #@param {type:"boolean"}
190
 
 
268
 
269
  gr.Interface(
270
  inference,
271
+ [gr.inputs.Audio(type="filepath", label="Input"),gr.inputs.Dropdown(choices=["Compressor", "Reverb", "Amp", "Analog Delay", "Synth2Synth"], type="value", default="Analog Delay", label="Effect Type"),gr.inputs.Slider(minimum=-24, maximum=24, step=1, default=-24, label="gain dB"),gr.inputs.Slider(minimum=-10, maximum=10, step=0.1, default=-1.4, label="c0"),
272
+ gr.inputs.Slider(minimum=-10, maximum=10, step=1, default=3, label="c1"),
273
+ gr.inputs.Slider(minimum=0, maximum=100, step=1, default=70, label="mix"),
274
+ gr.inputs.Slider(minimum=0, maximum=100, step=1, default=50, label="width"),
275
+ gr.inputs.Slider(minimum=5, maximum=120, step=1, default=30, label="max length")],
276
  gr.outputs.Audio(type="file", label="Output"),
277
  title=title,
278
  description=description,