Update app.py
Browse files
app.py
CHANGED
@@ -142,7 +142,7 @@ def tse(gt_file_input, text_input, num_infer_steps, eta, seed, guidance_scale, g
|
|
142 |
padding = target_length - current_length
|
143 |
mixture = np.pad(mixture, (0, padding), mode='constant')
|
144 |
mixture = torch.tensor(mixture).unsqueeze(0).to(device)
|
145 |
-
|
146 |
|
147 |
text_inputs = processor(
|
148 |
text=[text_input],
|
@@ -159,9 +159,9 @@ def tse(gt_file_input, text_input, num_infer_steps, eta, seed, guidance_scale, g
|
|
159 |
timbre = clapmodel.get_text_features(**inputs)
|
160 |
|
161 |
# mixture = autoencoder(embedding=mixture).squeeze(1)
|
162 |
-
|
163 |
-
|
164 |
-
return sample_rate, mixture.squeeze().cpu().numpy()
|
165 |
|
166 |
|
167 |
# CSS styling (optional)
|
|
|
142 |
padding = target_length - current_length
|
143 |
mixture = np.pad(mixture, (0, padding), mode='constant')
|
144 |
mixture = torch.tensor(mixture).unsqueeze(0).to(device)
|
145 |
+
mixture = autoencoder(audio=mixture.unsqueeze(1))
|
146 |
|
147 |
text_inputs = processor(
|
148 |
text=[text_input],
|
|
|
159 |
timbre = clapmodel.get_text_features(**inputs)
|
160 |
|
161 |
# mixture = autoencoder(embedding=mixture).squeeze(1)
|
162 |
+
pred = sample_diffusion(mixture, timbre, num_infer_steps, eta, seed, guidance_scale, guidance_rescale)
|
163 |
+
return sample_rate, pred.squeeze().cpu().numpy()
|
164 |
+
# return sample_rate, mixture.squeeze().cpu().numpy()
|
165 |
|
166 |
|
167 |
# CSS styling (optional)
|